RyoSugimoto
1/14/2013 - 2:26 AM

WordPressでの<title>要素の記述例。

WordPressでの要素の記述例。

<title><?php
global $page, $paged;
// Import global variables about pages
wp_title('|', true, 'right');
// Get and display the title of the current page
bloginfo('name');
// Get the title of your blog
$site_description = get_bloginfo('description', 'display');
// Get the description, with quotes fixed
if ($site_description && (is_home() || is_front_page())){
	echo "|$site_description";
}
// When the current page is home or front, display the description
if ($paged >= 2 || $page >= 2){
	echo '|'.sprintf(__('Page %s'), max($paged, $page));
}
// Display the number of the current page,
// if the page is an archive or a multi-paged article
?></title>