[wp-trac] [WordPress Trac] #14304: problem with post_type on custom post type in Loop

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 14 07:45:35 UTC 2010


#14304: problem with post_type on custom post type in Loop
--------------------------+-------------------------------------------------
 Reporter:  niceandripe   |       Owner:                   
     Type:  defect (bug)  |      Status:  new              
 Priority:  normal        |   Milestone:  Awaiting Review  
Component:  Post Types    |     Version:  3.0              
 Severity:  normal        |    Keywords:  custom post types
--------------------------+-------------------------------------------------
 I have registered a custom post type of 'directory' and in my loop i have
 something like this:

 {{{
 <?php if ( in_category( _x('gallery', 'gallery category slug') ) ) : ?>

    XXX - this is what i expect for gallery posts

 <?php elseif ( $post_type = 'directory' ) : ?>

    YYY - this is what i expect for directory (custom) posts

 <?php else : ?>

    ZZZ - this is what i expect for regular posts

 <?php endif;  ?>
 }}}

 however, even thou a regular post is not $post_type = 'directory' I'm
 getting '''YYY - this is what i expect for directory (custom) posts'''
 when I'm expecting '''ZZZ - this is what i expect for regular posts'''

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14304>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list