Forums

WP Sitemap
fix for small quirk with restoring original global $post (1 post)

  1. tmuka
    Member
    Posted 1 year ago #

    Great plugin, thanks! Just a quick note about a bug I noticed. In my theme i have an "edit page" link ( edit_post_link(); ) below the the_content(). On my sitemap page, the edit link has the postID of the last post from the sitemap.

    I fixed the plugin by adding to wp-sitemap.php

    $original_post = $post; //add after global $paged; on line 52

    --
    //add after line 117 to restore original post
    $post = $original_post;
    setup_postdata($post);

    Hope this helps!

    http://wordpress.org/extend/plugins/wp-sitemap/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags