WordPress Outer Loop Cycles
-
I am wondering how the WordPress “outer loop” works. By outer loop, I am referring to the core pages that run when WordPress is asked to deliver semantical content. The “WordPress loop is deep inside the outer loop. My question is not about the WordPress Loop.
When the url to a post in WordPress is called, WordPress runs once to put the post with a template, build a web page, and send the page back to the requester. From what I can see, after that process is complete, WordPress runs again, not always, but always when the requested url is for a post, to be displayed on via the single.php template.
Example, if you go to this post on my wordpress site, the outer loop runs twice, once for the requested post, then again for this post. Here is the data, showing timestamps and comments recorded by the pages as WordPress runs. The 2nd run data is in bold:
184016 Burning-Bridges.org: index.php: 73.183.150.152 **start this run time to record /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184017 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 before wp-load /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184018 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 after wp-load before wp() /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184019 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 before Mr. Template-Loader /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184020 Burning-Bridges.org: template-loader.php: 73.183.150.152 before do_action /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184021 Burning-Bridges.org: template-loader.php: 73.183.150.152 At door of mystery zone /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184022 Burning-Bridges.org: template-loader.php: 73.183.150.152 inside mystery zone /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184023 Burning-Bridges.org: template-loader.php: 73.183.150.152 escaped mystery zone /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184024 Burning-Bridges.org: template-loader.php: 73.183.150.152 about to maybe include a template /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184025 Burning-Bridges.org: template-loader.php: 73.183.150.152 template decision made, going for template /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184026 Burning-Bridges.org: template-loader.php: 73.183.150.152 template is: single.php /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184027 Burning-Bridges.org: single.php: 73.183.150.152 single dot lol haha php START /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184031 Burning-Bridges.org: single.php: 73.183.150.152 retunred from get_footer(), walk a amazing way /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184032 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 back from Mr. Template-Loader, everyone goes home! /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 184033 Burning-Bridges.org: index.php: 73.183.150.152 **everything done, nothing should be happening, except everyone walking away. /wordpress-has-an-outer-loop/ 2014-06-22 16:45:41 **** why doesn't WordPress stop here? This time stamp is made at the bottom of index.php, when everything needed for the request has been run and is complete, yet the following time stamps show programs rana again. <strong>184034 Burning-Bridges.org: index.php: 73.183.150.152 **start this run time to record /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:41 184035 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 before wp-load /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:41 184036 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 after wp-load before wp() /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184037 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 before Mr. Template-Loader /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184038 Burning-Bridges.org: template-loader.php: 73.183.150.152 before do_action /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184039 Burning-Bridges.org: template-loader.php: 73.183.150.152 At door of mystery zone /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184040 Burning-Bridges.org: template-loader.php: 73.183.150.152 inside mystery zone /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184041 Burning-Bridges.org: template-loader.php: 73.183.150.152 escaped mystery zone /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184042 Burning-Bridges.org: template-loader.php: 73.183.150.152 about to maybe include a template /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184043 Burning-Bridges.org: template-loader.php: 73.183.150.152 template decision made, going for template /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184044 Burning-Bridges.org: template-loader.php: 73.183.150.152 template is: single.php /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184045 Burning-Bridges.org: single.php: 73.183.150.152 single dot lol haha php START /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184049 Burning-Bridges.org: single.php: 73.183.150.152 retunred from get_footer(), walk a amazing way /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184050 Burning-Bridges.org: wp-blog-header.php: 73.183.150.152 back from Mr. Template-Loader, everyone goes home! /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42 184051 Burning-Bridges.org: index.php: 73.183.150.152 **everything done, nothing should be happening, except everyone walking away. /hit-logs-for-the-home-page-shows-outer-loop-with-no-rerun/ 2014-06-22 16:45:42</strong>
[Moderator Note: Please post log files between backticks or use the code button.]
- The topic ‘WordPress Outer Loop Cycles’ is closed to new replies.