[resolved] Excluding pages by template in wp_list_pages (3 posts)

  1. BrenFM
    Posted 5 years ago #

    This is an regular occurrence for me and wondered if anyone might have some bright ideas.

    On a lot of our theme designs we feature accordion pages - that is children pages that show up as content on the parent page in a jQuery based pop-out accordion.

    I define an accordion page as being any that uses a template file (in this case page-accordions.php) and use a custom WP_Query to show children pages that have the meta_value of page-accordions.php for the meta_key _wp_page_template.

    Next I use Tim Holt's Page List Plus plugin (fantastic work by the way, Tim!) which allows me to exclude these accordion pages from any wp_list_pages generated nav menu (typically in a sidebar menu).

    What I'd like to know is - can anyone think of a way I can automagically exclude pages from wp_list_pages when they are using a particular template according to the _wp_page_template meta key? I know wp_list_pages is pluggable, but I'm just not sure where to start.

  2. BrenFM
    Posted 5 years ago #

  3. BrenFM
    Posted 5 years ago #

    hrmmmm ignore that... seems there is meta_key stuff built into wp_list_pages - I've just never used it!

Topic Closed

This topic has been closed to new replies.

About this Topic