WP_TITLE()在非Root文件夹中与博客无法正常工作



我遵循本指南,以我的博客出现在 mydomain.com/blog

http://codex.wordpress.org/making_your_blog_appear_in_a_a_a_non-root_folder

简而言之,我正在使用自定义页面模板来创建静态页面"博客",然后将其呈现并呈现帖子:

<?php
/*
Template Name: Blog
*/
// Which page of the blog are we on?
$paged = get_query_var('paged');
query_posts('cat=-0&paged='.$paged);
// make posts print only the first part with a link to rest of the post.
global $more;
$more = 0;
//load index to show blog
load_template(TEMPLATEPATH . '/index.php');
?>

在我的主题中,我使用以下语法渲染<title>标签:

<title><?php bloginfo('name'); ?> | <?php is_front_page() ? bloginfo('description') : wp_title(''); ?></title>

此处在Codex中进行了描述:

http://codex.wordpress.org/function_reference/wp_title#covering_homepage

问题是现在在mydomain.com/blog上,WP_TITLE(''');

没有标题

如果我停止使用blog.php模板,则标题出现正确。显然,博客文章已经不复存在了。在这种情况下如何让WP_TITLE()显示正确的标题?

您应该遵循WordPress 2.1 :

的更新指南

http://codex.wordpress.org/creating_a_static_front_page

最新更新