在WordPress中,wp_title
显示两次或输出两次。
我在 functions.php 中添加了add_theme_support('title-tag')
。
网站的负责人:
<head>
<meta name="description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php me_get_favicon(); ?>
<title><?php wp_title(); ?></title>
</head>
答案 0 :(得分:1)
如果您已将<title><?php wp_title(); ?></title>
添加到functions.php文件中,则无需将add_theme_support('title-tag')
放入header.php文件中。
WordPress会自动添加带有该功能的标题标签。所以你手动添加它并且你告诉WordPress添加标题标签。从标题中删除标题标记,因为该函数实际上是WordPress核心的一个更新的动态添加。