情報を追記している場合はありますが、古い情報を訂正はしていませんので、公開年月日を参照してください。プラグイン・タグ、いずれもワードプレス・PHPのバージョン等によって動作しない場合もあります。
未設定の場合はホーム設定を表示、カテゴリーページではカテゴリー名をキーワードに追加
function common_description($description) {
global $post;
global $aioseop_options;
if (!is_front_page() && !get_post_meta($post->ID, _aioseop_description, true)) { $description = $aioseop_options['aiosp_home_description']; }
return $description;
}
add_filter('aioseop_description', 'common_description');
function common_keywords($keywords) {
global $post;
global $aioseop_options;
if (is_single() || is_page() || is_archive() && !get_post_meta($post->ID, _aioseop_keywords, true)) { $keywords = $aioseop_options['aiosp_home_keywords']; }
elseif (is_category()) { $cat = get_query_var('cat'); $keywords = get_cat_name($cat).",".$aioseop_options['aiosp_home_keywords']; }
return $keywords;
}
add_filter('aioseop_keywords', 'common_keywords');
カスタム投稿タイプの年アーカイブのタイトルにカスタム投稿タイプ名を追加、カスタムタクソノミーの年アーカイブにターム名とカスタム投稿タイプ名を追加
add_filter( 'aioseop_title', 'rewrite_year_titles' );
function rewrite_year_titles( $title ) {
if ( is_year() && is_post_type_archive('xxxx')) { $year = get_the_date('Y年');
$post_type = get_post_type_object( get_post_type() );
$blog_title = get_bloginfo();
$title = $year . " | " . $post_type->labels->name . " | " . $blog_title;
}
if ( is_year() && is_tax('xxxxxx','')) { $year = get_the_date('Y年'); $term = get_query_var('term'); $term_info = get_term_by('slug', $term, 'xxxxxx');
$post_type = get_post_type_object( get_post_type() );
$blog_title = get_bloginfo();
$title = $year . " | " . $term_info->name . " | " . $post_type->labels->name . " | " . $blog_title;
}
return $title;
}