Make WordPress Core

Opened 7 years ago

Last modified 4 years ago

#17590 closed defect (bug)

wp_list_pages() not setting "current_page_item" classes on custom post types — at Initial Version

Reported by: tobiasn Owned by:
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.1
Component: Posts, Post Types Keywords: has-patch commit
Focuses: Cc:


wp_list_pages() don't set the correct css for a hierarchical custom post type.

To reproduce this bug do this: <?php wp_list_pages("title_li=&post_type=custom_post_type_name"); ?>

and compare the html output to normal pages: <?php wp_list_pages(); ?>

The problem seems to be this row in wp_list_pages():

if ( is_page()
is_attachment() $wp_query->is_posts_page )

In the following patch i've changed it to

if ( is_page()
is_attachment() $wp_query->is_posts_page ($wp_query->query_varspost_type? != 'post' && is_single()) )

(If this is not the intended behavoir please let me know. )

Change History (1)

7 years ago

wp_list_pages() css patch for custom post types

Note: See TracTickets for help on using tickets.