[wp-trac] Re: [WordPress Trac] #4162: query_posts('p=<id>') = always a full post

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 20 16:26:59 GMT 2007


#4162: query_posts('p=<id>') = always a full post
-----------------------+----------------------------------------------------
 Reporter:  devil1591  |        Owner:  anonymous
     Type:  defect     |       Status:  closed   
 Priority:  high       |    Milestone:  2.2      
Component:  General    |      Version:  2.2      
 Severity:  blocker    |   Resolution:  invalid  
 Keywords:             |  
-----------------------+----------------------------------------------------
Changes (by Otto42):

  * status:  reopened => closed
  * resolution:  => invalid

Comment:

 If you do a query_posts('p=1'), you're supposed to get the whole post
 back. Doing this will cause $is_single to be set to true, since you're
 requesting a single post. And setup_postdata() will then force $more=1
 when is_single() returns true.

 The reason that your "new WP_Query()" functionality doesn't do that is
 because you created your own query instead of using the global one, and
 thus did not set the normal default query's $is_single but set a local one
 instead. And so setup_postdata(), which is looking at the default query
 only, does not see the is_single() and thus does not force $more=1.

 In other words, I believe this is expected behavior. Creating a new query
 and using the default query are actually two different things, not just
 different ways of doing the same thing.

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


More information about the wp-trac mailing list