Skip to content

Instantly share code, notes, and snippets.

@hideack
Last active June 14, 2020 12:11
Show Gist options
  • Save hideack/3b1e4d0be96b27f8560de6578251eae3 to your computer and use it in GitHub Desktop.
Save hideack/3b1e4d0be96b27f8560de6578251eae3 to your computer and use it in GitHub Desktop.
<?php
function change_title_tag( $title ) {
//条件分岐タグ等を使ってページにより $title を変更する処理
if (is_date()) {
$title = get_the_title($title) . " | " . get_bloginfo('name');
}
return $title;
}
add_filter( 'pre_get_document_title', 'change_title_tag' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment