WordPress.org

Ready to get started?Download WordPress

Forums

Thematic
[Thematic] in_the_loop() not resetted after the loop? possible bug? (1 post)

  1. durroon
    Member
    Posted 2 years ago #

    Hi all, especially thematic developers,

    while writing a plugin which changes the title of a certain page using the 'the_title' filter hook, I observed a weird behaviour. I used in_the_loop() to check if I am inside the loop, thus being able to only change the title above the actual page content (not the menus, etc).

    Actually, the title was changed in the pages widget of the primary aside sidebar, which is definitely not in the loop ;)

    I wrote a simple footer hook to check the state of the in_the_loop flag. It is still set to true in the footer. I only observed this behavior using thematic. For twentyeleven, etc., everything seems to be fine. I am using the latest version of thematic, 0.9.7.7.

    Here is the footer hook I used to check the flag:

    function bug_footer_in_the_loop() {
    echo '<div>Still in the loop? '.in_the_loop().'</div>';
    }
    add_action('wp_footer', 'bug_footer_in_the_loop');

    http://wordpress.org/extend/themes/thematic/

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags