WordPress的显示帖子仅修改
答
function display_updated_posts() {
/* These are the arguments to pass into WP_Query */
$modifiedposts_args = array('orderby' => 'modified', 'ignore_sticky_posts' => '1');
$modifiedposts_loop = new WP_Query($modifiedposts_args);
$counter = 1;
echo '<ul>';
while($modifiedposts_loop->have_posts() && $counter < 5) {
$modifiedposts_loop->the_post();
echo '<li><a href="' . get_permalink($modifiedposts_loop->post->ID) . '"> '
.get_the_title($modifiedposts_loop->post->ID) . '</a> ('
. get_the_modified_date() .') </li>';
$counter++;
}
echo '</ul>';
wp_reset_postdata();
}
指这个,我希望这对您有所帮助,
http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-last-updated-posts-in-wordpress/
欢迎StackOverflow上。请注意,这不是免费的 代码写入服务,但我们非常乐意帮助其他程序员 (和有志之士)编写自己的代码。请阅读帮助主题 [如何询问一个好的 问题](http://stackoverflow.com/help/how-to-ask)。之后, 请使用您所写的代码更新您的问题到目前为止 为了完成您希望实现的任务。 –
删除一些不需要的额外文本。 – rlandster