[wp-trac] [WordPress Trac] #18561: Better Way to Insert Things Below Individual Posts

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 1 17:12:47 UTC 2011


#18561: Better Way to Insert Things Below Individual Posts
-------------------------+------------------------------
 Reporter:  jane         |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.2.1
 Severity:  minor        |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by Otto42):

 loop_end won't work because it only fires after the last post in the loop.
 You can't use it on a page with more than one post, for example.

 There is the_post hook in setup_postdata, however this has the problem
 that it fires before every post's output, and that it has the next post
 already set up by the time it fires. So having it output something
 specific to the previous post is problematic.

 There is no currently existing hook that will work.

 As for standardizing on part names, we already have two examples of
 "standard" names:

 Twenty Eleven uses the "content" name for calling a template to output a
 single post. The get_template_part call for the "content" is always called
 inside an existing Loop.

 Twenty Ten uses the "loop" name for calling a template that runs an entire
 Loop from inside a normal template. So the get_template_part('loop',...);
 is used to run possibly more than one post.

 This would make a decent starting point for a naming scheme.

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


More information about the wp-trac mailing list