WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Problem with query being reset in v0.3.2 (6 posts)

  1. Andy Keith
    Member
    Posted 3 years ago #

    Hi,

    Just a quick note to say that the latest version of the plugin (0.3.2) seems to be resetting the query when calling wp_head(). This wasn't happening in earlier versions.

    This caused an issue on one of our sites where we were modifying the main loop for a page using a call to query_posts BEFORE calling wp_head. This no longer worked with the latest version of WordPress SEO as the call to wp_head (which executes the initial WordPress SEO code) reset the query, losing our custom data. I've fixed this by moving our custom loop code to occur AFTER the call to wp_head, but thought it was worth mentioning in case other people have the same problem.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. LBruun
    Member
    Posted 3 years ago #

    Hi,

    I am not clued up in regards to functions, but my custom search function stopped working after the upgrade... I am not sure how to fix this...

    Kr

    Lars

  3. Andy Keith
    Member
    Posted 3 years ago #

    If you're ok editing code, you'd need to find where the custom search is being done - probably a call to get_posts, query_posts or using WP_Query directly - and make sure this appears AFTER the call to wp_head(). The call to wp_head() is usually from the header.php file in your theme.

    Andy

  4. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    It's good to mention, the reason my plugin does this is that so many themes screw up in the head section that they global $post etc, causing the wrong title and descriptions to display, hence the reset.

  5. Andy Keith
    Member
    Posted 3 years ago #

    Fair point, thanks for clarifying. Great plugin btw...!

  6. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks, glad you like it :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic