[wp-trac] [WordPress Trac] #14846: in_category returning true when last post is from specified category

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 12 15:53:33 UTC 2010


#14846: in_category returning true when last post is from specified category
-----------------------------+----------------------------------------------
 Reporter:  enrique-ramirez  |       Owner:                 
     Type:  defect (bug)     |      Status:  new            
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  3.0.1          
 Severity:  major            |    Keywords:                 
-----------------------------+----------------------------------------------

Comment(by nacin):

 If you call query_posts() like that and your loop excludes category 8,
 then in_category(8) will never be true. Are you saying that's exactly
 what's happening? This should produce a string of bool(false)'s.

 {{{
 query_posts('cat=-8');
 if ( have_posts() ) while( have_posts() ) : the_post();
    var_dump( in_category(8) );
 endwhile; endif;
 }}}

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


More information about the wp-trac mailing list