Wordpress 在帖子视图中显示自定义类型帖子的列表
在单篇文章页面上,我需要能够显示某个自定义文章类型的五篇最新文章的列表。它应该像一个变更日志一样工作。它们需要以以下格式显示:Wordpress 在帖子视图中显示自定义类型帖子的列表,wordpress,changelog,Wordpress,Changelog,在单篇文章页面上,我需要能够显示某个自定义文章类型的五篇最新文章的列表。它应该像一个变更日志一样工作。它们需要以以下格式显示: (published date) (post content) (published date) (post content) (published date) (post content) (published date) (post content) (published date) (post content) 一般来说,我知道通过编辑主题来寻找什么以及如何做到
(published date) (post content)
(published date) (post content)
(published date) (post content)
(published date) (post content)
(published date) (post content)
一般来说,我知道通过编辑主题来寻找什么以及如何做到这一点,但我想知道是否有任何插件或插件组合可以帮助我比编辑主题文件更容易地完成这一任务?我并不懒得这么做,但我需要在许多新的wordpress网站上这样做,这些网站需要快速构建,我没有时间手动编辑每个wordpress主题
这里有一个实际的例子:网站上有一篇关于某个在线软件的帖子,该软件很受欢迎并获得流量。必须在需要定期更新的帖子中显示变更日志。因此,网站管理员只需在一句话中输入新的变更日志,单击发布,它就会显示在关于软件的帖子中,从而创建一个包含变更日志的列表
谢谢 您可以使用以下代码
<?php $args = array( 'post_type' => 'your post name here','posts_per_page' => 5 );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<?php echo get_the_time('Y-m-d', $post->ID);
echo the_content();
?><?php endforeach;