打开自定义-主页设置,包括如下内容:
您可以选择在您站点的主页上显示什么。可以是按时间降序排列的文章(传统博客),也可以是固定/静态页面。要设置静态主页,您需要创建两个页面,其中一个会变成主页,而另一个将会显示您的文章。


包括如下选项:
1、您的最新文章(默认)
2、一个静态页面
1)主页
2)文章页
说明:
‘show_on_front’: 对应“主页设置–您的主页显示”:
返回值:
Data type: String:
“ posts ” : 对应 “ 您的最新文章 ”(默认)
“ page ” : 对应“ 一个静态页面 ”
如果选择了“ 一个静态页面 ”,则:
“ page_on_front ”: Data type: Integer
The ID of the page that should be displayed on the front page.
“ page_for_posts ” : Data type: Integer
The ID of the page that displays posts. Data type: Integer
举例说明:
if ( 'posts' == get_option( 'show_on_front' ) )
{ include( get_home_template() ); }