Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress创建带有帖子索引的特殊子页面_Wordpress_Themes - Fatal编程技术网

Wordpress创建带有帖子索引的特殊子页面

Wordpress创建带有帖子索引的特殊子页面,wordpress,themes,Wordpress,Themes,我有一个wordpress博客,我将首页设置为一个页面,而不是一系列的帖子。现在,我想在子页面上创建最近文章的索引。例如,我想在用户键入/domain.com/articles/时列出最近的帖子,并在某人键入/domain.com/时显示页面 我不想使用插件,我想把它直接编码到主题中 如果您为slug创建了一个包含文章的新页面(即www.domain.com/articles,其中articles是“slug”),您可以在主题中创建名为page-articles.php的自定义模板文件,用于设置

我有一个wordpress博客,我将首页设置为一个页面,而不是一系列的帖子。现在,我想在子页面上创建最近文章的索引。例如,我想在用户键入/domain.com/articles/时列出最近的帖子,并在某人键入/domain.com/时显示页面


我不想使用插件,我想把它直接编码到主题中

如果您为slug创建了一个包含文章的新页面(即www.domain.com/articles,其中articles是“slug”),您可以在主题中创建名为page-articles.php的自定义模板文件,用于设置文章页面的样式。然后可以将循环代码从index.php传输到page-articles.php