原作者链接(大量参考)
vim /usr/share/nginx/html/wordpress/wp-includes/widgets/class-wp-widget-recent-posts.php
找到如下代码删除并修改
1 2 3 4 5 6 7 8 9 10 11 12 |
<ul> <?php $recentPosts = new WP_Query(array('post__not_in' => get_option('sticky_posts'),'posts_per_page' => $number)); ?> <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?> <li> <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php echo get_the_title(); ?></a> <?php if ( $show_date ) : ?> <?php the_time('y/m/d'); ?> <?php endif; ?> </li> <?php endwhile; wp_reset_query();?> </ul> |