Wordpress - 自定义博客页面

时间:2010-12-05 13:04:31

标签: php wordpress

我想展示一个静态首页和自定义帖子页面。我为此创建了2个页面模板。

page-template-home.php //commented it as Template Name: Home Template)
page-template-blog.php //commented it as Template Name: Blog Template)

然后创建2个wordpress页面Home和Blog,然后为主页,将页面模板设置为Home Template,对于博客页面,将页面模板设置为Blog Template。

来自设置>读我设置

Front page: Home
Posts page: Blog

现在主页很完美,但博客页面似乎加载index.php而不是page-template-blog.php

我遗失或做错的任何事情?

1 个答案:

答案 0 :(得分:1)

你在这里为自己做了一些工作 - 我会忘记自定义模板,而是使用template hierarchy - front-page.php作为主页(首页),home.php表示博客页面。

您仍需要按照问题中的说明进行设置,但“控件”页面现在独立于呈现它们的模板:)

相关问题