我是WordPress的新手,被要求更改标题标签中的值。标题标签的格式为:“站点名称|标语”,在标题中动态设置。php(从其他帖子中可以看到,这似乎是WordPress的标准代码)。
我只需要更改主页上的口号。网站内的所有其他页面都可以,我只需要更改主页,我不知道标题的“口号”部分是否在某处编码,或设置为属性等。我在哪里以及如何更改它??谢谢
我是WordPress的新手,被要求更改标题标签中的值。标题标签的格式为:“站点名称|标语”,在标题中动态设置。php(从其他帖子中可以看到,这似乎是WordPress的标准代码)。
我只需要更改主页上的口号。网站内的所有其他页面都可以,我只需要更改主页,我不知道标题的“口号”部分是否在某处编码,或设置为属性等。我在哪里以及如何更改它??谢谢
你可以做两件事中的一件。第一种建议的方法是使用一个插件,如WordPress SEO. 安装并更换<title>
在您的header.php
使用文件:
<title><?php wp_title(\'\'); ?></title>
或者,您可以使用is_front_page
或is_home
条件。<title>
<?php
bloginfo(\'name\'); // this is the blog name
echo \' | \'; // seperator
if(is_front_page())
{
// what you want for the home page here
}
else
{
bloginfo(\'description\'); // this is the slogan
}
</title>
这有点草率,我建议您考虑使用wp_title
相反二十一点十一分header.php
有一个很好的例子this:
<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";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo \' | \' . sprintf( __( \'Page %s\', \'twentyeleven\' ), max( $paged, $page ) );
?></title>
转到管理仪表板>设置>常规
您正在获取常规设置。。。
所有设置都是他们的。。。。
我需要更换#site-title 我发现了一篇很好的博客文章解释了这一点:http://bentcorner.com/replacing-wordpress-twenty-eleven-site-title-with-an-image/但似乎要放置的图像background: url(/header.png) #fff no-repeat; 必须始终位于根目录中(~/public_html).我用的是20个精灵child theme和我尝试将图像文件放置在images 子主题的子目录,但执行此操作时,不会