[wp-trac] [WordPress Trac] #9425: is_home returns false when specifying included categories only

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 31 18:40:54 GMT 2009


#9425: is_home returns false when specifying included categories only
--------------------------+-------------------------------------------------
 Reporter:  mtg169        |       Owner:  anonymous               
     Type:  defect (bug)  |      Status:  new                     
 Priority:  normal        |   Milestone:  Unassigned              
Component:  General       |     Version:  2.7.1                   
 Severity:  normal        |    Keywords:  is_home, query.php, cat=
--------------------------+-------------------------------------------------
 Thought I had a problem with a plugin, but it appears to be a bug with
 query.php. On the home page, when I do the following query, is_home
 returns true:
 {{{query_posts("cat=-1,-6,-11,-21,-23,-24,-27,-35,-38,-40&posts_per_page=1");}}}

 Ideally I would like to specify included categories only so I do not have
 to modify the code every time a new category is added. If I use the
 following query, is_home always returns false even though I am on the home
 page:
 {{{query_posts("cat=3,4,5,7&posts_per_page=1");}}}

 The only way I can get is_home to return true is if I exclude at least one
 category (could even be -0).

 For the mean time I have just specifically defined is_home=true on my home
 page, rather than having query.php set it incorrectly.

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


More information about the wp-trac mailing list