layers_before_post_loop

Since: 1.0.7 Last Updated:
Back to Main Index

Outputs your custom code after the post section wrapper, and before the loop.

Location: single.php

Code output appears after:

Code output appears before:

Usage:

This hook is very useful for inserting custom code, but its location also makes it appropriate for use with query_posts() or any custom function that modifies the loop which does not require the loop itself to be edited. This works almost exactly like pre_get_posts, except our action allows you to influence only the single post loop separately from other templates. Be careful when using query_posts though – you must rewind or reset the query using layers_after_post_loop if you do this!