Wordpress博客的网站标题/标题
问题描述:
我希望我的博客的标题在主页上显示为一个内容,而在我的博客上显示为其他任何内容时的内容。Wordpress博客的网站标题/标题
此代码是否正确?
<title>
<?php
if (is_home())
echo "Blog Title" //When on the homepage
else
echo ucwords(wp_title('',true)); //Name of blog article
echo ucwords(get_bloginfo('name')); //Followed by site name
?>
</title>
任何反馈意见。
答
只有一件事,你应该在wp_title
功能通过false
echo ucwords(wp_title('',false));
wp_title功能呼应标题,如果第二个参数为真过去了,如果它是通过假它将返回标题为进一步操作
答
假设您的函数正在工作并检索正确的数据,该代码完全可以接受您正在使用的数据。
它工作吗? – Galen 2011-04-22 18:11:06
是的,是的。 – Blender 2011-04-22 18:13:59