Last-Modified
1月 2nd, 2007 by admin
2006.1.4投稿記事
標準のままでは更新ソフト等でチェックした場合Last-Modifiedが出力されない?ので、1.5の時は「wp-blog-header.php」ファイルを編集しましたが、2.0では変更になっているようで探したところ「wp-includes/classes.php」のsend_headers関数を編集すればよさそうです。
function send_headers() {
global $current_user;
@header('X-Pingback: '. get_bloginfo('pingback_url'));
if ( is_user_logged_in() )
nocache_headers();
if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) {
status_header( 404 );
} else if ( empty($this->query_vars['feed']) ) {
//ここから追加
if ( $this->query_vars['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) . '"';
@header("Last-Modified: $wp_last_modified");
//ここまで追加
@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));

[...] 結果的になんとかなりました。検索様々。先人の情報公開様々です。 MacFeeling Blog で見つけました。MacFeeling Blogさん、ありがとうございました。 [...]