Add Date to Recent Posts Widget?

This is a default feature which by default is set not to show the post date. Here is the part of the code responsible to show/hide the post date <?php if ( $show_date ) : ?> <span class=”post-date”><?php echo get_the_date(); ?></span> <?php endif; ?> To enable the post date, just check the Display post date? … Read more

How do I use wp_get_recent_posts?

Don’t use the ‘helper’ methods, they tend to cause more trouble than they’re worth. Any time you want to grab posts, be it the latest, the oldest, in a category etc, use a WP_Query loop, here is its standard form: $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) … Read more

Display recent posts with thumbnail within Masonry

Add the meta_key parameter to fetch the latest posts which have featured image set. $args = array( ‘numberposts’ => ’10’, ‘meta_key’ => ‘_thumbnail_id’ ); <?php /* Template Name: Recent Profiles */ get_header(); ?> <h1 class=”page-title”><?php the_title(); ?></h1> <div id=”content”> <div id=”masonry”> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div … Read more

Custom text box containing post titles

If you type “WordPress get recent posts” into Google you will see, right at the top of the list, wp_get_recent_posts. Follow that link and you will end up on that function’s “Function Reference” page in the Codex, where you will find, about halfway down, that someone has posted an example that does pretty much exactly … Read more