loops in sidebar causing is_single() in footer to fail
-
I have a theme with a loop in the index.php or a single.php which call get_sidebar() and then get_footer(). I also have a loop in the sidebar.php based on categories.
I have a plugin that does some work when wp_footer() is executed.
It checks for is_single() to descide on its work but by the time the footer is called, the sidebar.php is already executed and is_single() is now false again and instaid is_category() is now true.So I need a way to ‘forget’ that the category loop was executed and ‘reset’ the is_single() to true in some way.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘loops in sidebar causing is_single() in footer to fail’ is closed to new replies.