【发布时间】:2016-04-28 16:47:57
【问题描述】:
如何在其存档页面上返回静态页面以及作者的帖子? 我们的网站将静态页面用于信息内容,将帖子页面用于博客区域。
非常感谢您。
【问题讨论】:
-
您可以使用 WP_Query 查询帖子,并可以通过developer.wordpress.org/reference/classes/wp_query 的文档进行参考
如何在其存档页面上返回静态页面以及作者的帖子? 我们的网站将静态页面用于信息内容,将帖子页面用于博客区域。
非常感谢您。
【问题讨论】:
您只需在主题目录中创建一个author.php 页面。在该页面内,您可以根据需要编写简单的 WordPress 循环和所有静态内容...。这样,您的作者的帖子将显示在此页面上...例如,您可以以这种方式进行 ....假设我们在 author.php 页面中编写此内容;
<?php get_header();?>
<?php
//all your static code and loop content will go here inside according to nature of content ...like static content with in DIVs and php content inside php tags etc
?>
<?php get_footer();?>
希望这是有道理的,更多信息请访问https://codex.wordpress.org/Author_Templates
【讨论】: