我正在构建一个儿童主题,目前它有一个非常简单的<head>
标题中的节。php:
<head>
<meta charset="<?php bloginfo( \'charset\' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?php wp_title( \'|\', true, \'right\' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( \'pingback_url\' ); ?>">
<!--[if lt IE 9]>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/html5shiv.min.js"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
我猜是吧wp_head()
负责第二个<title>
元素(它出现在最终的HTML中),但我读到的其他内容表明这是不可能的。我应该删除<title>
从我的标题。php,或者我应该向函数中添加一些内容来删除标题wp_head()
(例如。remove_action(\'wp_head\', \'title\'
) ?
还是我应该做些别的事情?