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.