WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] loops in sidebar causing is_single() in footer to fail (3 posts)

  1. ddeconin
    Member
    Posted 4 years ago #

    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.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

  3. ddeconin
    Member
    Posted 4 years ago #

    Thx !

Topic Closed

This topic has been closed to new replies.

About this Topic