[英]wp_title is blank on all pages in wordpress site
I am relatively new to wordpress. 我对Wordpress还是比较陌生。 I have an issue where the wp_title is displaying blank on ALL pages of my site.
我有一个问题,其中wp_title在网站的所有页面上都显示为空白。
I've see a few posts addressing the page title not displaying on the index page, but haven't found anything related to it not displaying on ALL pages of the site. 我看到一些有关页面标题的文章未显示在索引页上,但是没有找到与之相关的任何内容未显示在网站的所有页面上。
Using the code below, my title tag is rendered with the site name, but no page name: 使用下面的代码,我的标题标签使用站点名称呈现,但没有页面名称呈现:
<title>
<?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
</title>
Like I said, I'm new to using Wordpress so there's a very high chance I'm missing something really obvious here... 就像我说的那样,我是使用Wordpress的新手,所以很有可能我在这里遗漏了一些非常明显的东西……
Why don't you use ? 你为什么不使用? printf (get_bloginfo('url')), printf (get_bloginfo('description'), printf ('sitename').
printf(get_bloginfo('url')),printf(get_bloginfo('description'),printf('sitename')。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.