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

Custom recent-posts shortcode’s thumbnail image not in line with rest of code

The problem is: the_post_thumbnail() outputs its content immediately. It’s basically like echoing instead of returning. To fix it, you should be able to just replace the_post_thumbnail(‘thumbnail’, [‘class’ => ‘droplet-img’, ‘title’ => get_the_title()]) with get_the_post_thumbnail(‘thumbnail’, [‘class’ => ‘droplet-img’, ‘title’ => get_the_title()])

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

menu item to display the most recent post

If you want to perform any redirects, you have to send your header before site sends any output. Shortcodes are run when the content is obtained, parsed and printed. So the site will already be partially sent to the browser, so you won’t be able to perform any redirects any more. So you should run … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)