【发布时间】:2015-05-22 15:05:38
【问题描述】:
我有一个 WP 网站,并使用 yoast seo。
现在,在我的 html 级别的网站中。我的代码如下所示
<title>my website</title><title>my website</title>
标题中相同标题部分的 2 次。现在怎么解决呢? header.php 的任何问题。谢谢
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php
language_attributes();
?>>
<head>
<meta http-equiv="Content-Type" content="<?php
bloginfo('html_type');
?>;
charset=<?php
bloginfo('charset');
?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
<?php
if (function_exists('is_tag') && is_tag()) {
single_tag_title('Tag Archive for "');
echo '" - ';
} elseif (is_archive()) {
wp_title('');
echo ' Archive - ';
} elseif (is_search()) {
echo 'Search for "' . wp_specialchars($s) . '" - ';
} elseif (!(is_404()) && (is_single()) || (is_page())) {
wp_title('');
echo ' - ';
} elseif (is_404()) {
echo 'Not Found - ';
}
if (is_home()) {
bloginfo('name');
echo ' - ';
bloginfo('description');
} else {
bloginfo('name');
}
if ($paged > 1) {
echo ' - page ' . $paged;
}
?>
</title>
【问题讨论】:
-
请将代码发布到 header.php。
-
没有更多的代码,我们无能为力
-
我已经添加了代码。请再次检查,谢谢