Query is never reset on index.php (5 posts)

  1. David Gard
    Posted 4 years ago #

    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?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

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

  3. David Gard
    Posted 4 years ago #

    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.

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    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.

  5. David Gard
    Posted 4 years ago #

    Thanks Esmi, will look in to shortly.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.