[wp-trac] [WordPress Trac] #21525: wp_list_pages: current page css fails with custom post types

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 9 09:38:33 UTC 2012


#21525: wp_list_pages: current page css fails with custom post types
---------------------------+------------------------------
 Reporter:  martin.czerwi  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Post Types     |     Version:  3.4.1
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+------------------------------

Comment (by martin.czerwi):

 As an addition, when modifying the core file wp-includes/post-template.php
 with a check like 'is_post_type_hierarchical', everything worked as
 expected. My final code looks like this:

 {{{
 if ( is_page() || is_attachment() || $wp_query->is_posts_page ||
 is_post_type_hierarchical( $wp_query->query['post_type'] ) )
     $current_page = $wp_query->get_queried_object_id();
 }}}

 Maybe it's even possible to leave out is_page() in the statement. I didn't
 try that.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21525#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list