[wp-trac] [WordPress Trac] #14679: in_category returns true for parent cat if last item on page is from tested subcat

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 24 13:48:54 UTC 2010


#14679: in_category returns true for parent cat if last item on page is from tested
subcat
-------------------------------------+--------------------------------------
 Reporter:  Usurper                  |        Owner:         
     Type:  defect (bug)             |       Status:  closed 
 Priority:  normal                   |    Milestone:         
Component:  Template                 |      Version:  3.0    
 Severity:  normal                   |   Resolution:  invalid
 Keywords:  in_category, categories  |  
-------------------------------------+--------------------------------------
Changes (by scribu):

  * status:  new => closed
  * resolution:  => invalid
  * milestone:  Awaiting Review =>


Comment:

 in_category() is meant to test wether the current post in The Loop belongs
 to a certain category.

 You are trying to use it like is_category(), which is a conditional tag.

 Reference:

 http://codex.wordpress.org/Function_Reference/in_category

 http://codex.wordpress.org/Conditional_Tags

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


More information about the wp-trac mailing list