WordPress.org

Ready to get started?Download WordPress

Forums

Last-Modifide time on /?feed=comments-rss2 not updating (2 posts)

  1. natealderson
    Member
    Posted 8 years ago #

    I am running 1.5.1.3 and I noticed that the Last-Modified time for /?feed=comments-rss2 was not being updated after a new comment was made.

    After I set my permalink to /%year%/%monthnum%/%day%/%postname%/
    the Last-Modified time changed for /comments/feed/ after a new comment was made.

    Any ideas?

  2. Chris_Dolan
    Member
    Posted 8 years ago #

    I found a fixed this bug in my own WP. Edit wp-blog-header.php to add "|| $feed == 'comments-rss2'"

    That is, change the code from

    } else if ( empty($feed) ) {
    @header('X-Pingback: '. get_bloginfo('pingback_url'));
    @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    } else {
    // We're showing a feed, so WP is indeed the only thing that last changed
    if ( $withcomments )
    $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
    else
    $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
    $wp_etag = '"' . md5($wp_last_modified) . '"';

    to

    } else if ( empty($feed) ) {
    @header('X-Pingback: '. get_bloginfo('pingback_url'));
    @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    } else {
    // We're showing a feed, so WP is indeed the only thing that last changed
    if ( $withcomments || $feed == 'comments-rss2')
    $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
    else
    $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
    $wp_etag = '"' . md5($wp_last_modified) . '"';

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags