WordPress.org

Support

Support » How-To and Troubleshooting » If exclude parent page from wp_list_pages, exclude child too

If exclude parent page from wp_list_pages, exclude child too

  • xxangel
    Member

    @xxangel

    Is there a way to exclude child pages from wp_list_pages just by excluding the parent?

    Pretend I have a page titled “About” with ID “5” and “Me” with ID “6”. If I write:

    <?php wp_list_pages(‘exclude=5&title_li=’); ?>

    The “Me” page still shows up as a link. Is there a way to do the exclude=5 and then exclude any pages under it?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘If exclude parent page from wp_list_pages, exclude child too’ is closed to new replies.