Support » Fixing WordPress » Query is never reset on index.php

  • Hey all,

    I’ve noticed that when posts are displayed using index.php that the query is not reset at the end (even if I add wp_reset_query()).

    Ordinarily, not a problem, but when users log out of my site a filter is used to determine where to send them. Because of this, people who log out from the index page are being sent to the URL of the bottom article on the page.

    To fix this I’ve added this condition to the function that the logout_url filter uses, but I feel that it’s not really somthing that should need to be done –

    if(is_home() || is_front_page()) :
        $redirect = get_bloginfo('home');

    Is this a WP bug, does anybody know? Or is there somthing that I am missing?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi


    Forum Moderator

    If you can replicate the problem using Twenty Eleven and no plugins, then it might be worth raising this in Trac.

    Will have a play in a minute. Didn’t want to Trac it before I was sure it was a bug, as there may be a very good reason for the behaviour that I am not aware of.



    Forum Moderator

    I had a quick look through Trac for a similar report but couldn’t find anything (that said, my Trac-fu isn’t wonderful, I’ll admit). But it strikes me that this could have been completely overlooked unless you are doing something pretty special (which you are).

    If you want, you could try asking on the wp-hackers list first. They’re the kind of folks who might have tried something similar to what you are doing and are therefore the most likely to have come across the issue before. A couple of the core devs also subscribe to the list, so you might also be able to get some “inside” info on this.

    Thanks Esmi, will look in to shortly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Query is never reset on index.php’ is closed to new replies.