[wp-trac] [WordPress Trac] #10048: Condition tag is_home() returns wrong result if it is called after query_posts()

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 6 12:06:18 GMT 2009


#10048: Condition tag is_home() returns wrong result if it is called after
query_posts()
--------------------------+-------------------------------------------------
 Reporter:  kamiyeye      |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  2.8
Component:  General       |     Version:  2.8
 Severity:  major         |    Keywords:     
--------------------------+-------------------------------------------------
 == Pre-requisites: ==
 Prepare a test-purpose php script, say:

 {{{
 $home = is_home() ? 'you are home': 'you are NOT home';
 echo '<script type="text/javascript">alert("'.$home.'")</script>';

 query_posts('showposts=1');

 $home = is_home() ? 'you are home': 'you are NOT home';
 echo '<script type="text/javascript">alert("'.$home.'")</script>';
 }}}

 == Repro Steps ==
 1. Insert the test-purpose php script into a template php file, say
 single.php, then save.[[BR]]
 2. Visit any single post page in the blog

 == Expected Result ==
 A message box pops up twice with the same text on it: you are NOT home

 == Actual Result ==
 A message box pops up twice with differen texts on it, first is "you are
 NOT home", second is "you are home"

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


More information about the wp-trac mailing list