Add Date, Author & Comments to Latest From Blog Shortcode

For Default Latest Blog Posts Shortcode

Via FTP access your server Find shortcodes.php file in wp-content/themes/Sterling/framework/theme-specific/ Open the file and look for the following code from line 149 to line 152:

 $output .= '<div class="article_preview">'; $output .= '<strong><a href="'.esc_url( $permalink ).'">'.get_the_title().'</a></strong>'; $output .= '<p>'.$post_content.'...</p>'; $output .= '</div>'; 

Change to this code:

 $output .= '<div class="article_preview">'; $output .= '<strong><a href="'.esc_url( $permalink ).'">'.get_the_title().'</a></strong>'; $output .= '<br/><span class="author"><strong>Posted by</strong> <a href="'.get_author_posts_url($post->post_author).'">'.get_the_author().'</a> <strong>on</strong> </span>'; $output .= '<span class="time">'.get_the_time('j').'</span> '; $output .= '<span class="time">'.get_the_time('M').'</span>'; $output .= ','; $output .= '<span class="time"> '.get_the_time('Y').'</span>'; $comment_count = get_comment_count($post->ID); $approved_comment_count = $comment_count['approved']; $output .= '<span class="comments"> with '.$approved_comment_count.' Comments</span>'; $output .= '<p>'.$post_content.'...</p>'; $output .= '</div>'; 

Then add the following code to the Custom CSS area in Site Options > Styling Options:

 .article_preview .author {margin-left:25px;} .article_preview .author, .article_preview .time, .article_preview .comments  {font-family:Georgia;font-style:italic;line-height:30px !important;font-size:12px;} 

(click screenshots for full-size view)


For Custom Latest Blog Posts Shortcode with Featured Image Plugin

If you have installed the Blog Posts Shortcode Featured Image custom Plugin, then follow these instructions instead: Via FTP access your server Find blog_posts_shortcode_featured_image.php file in wp-content/plugins/blog_posts_shortcode_featured_image/ Open the file and look for the following code from line 76 to line 86:

 $output .= '<div class="blog_posts_featured_holder">';		 $output .= '<div class="blog_posts_featured_image">'; $post_thumb = "[raw]<a href='".$permalink."'><img src='".$image_src."' alt='".get_the_title()."' /></a>[/raw]"; $output .= $post_thumb;	 $output .= '</div>';	 $output .= '<div class="blog_posts_featured_content">'; $output .= '[raw]<strong><a href="'.$permalink.'">'.get_the_title().'</a></strong>[/raw]'; $output .= '[raw]<p>'.$post_content.'...</p>[/raw]'; $output .= '</div>'; $output .= '<div class="hr hr-dotted"> </div>'; $output .= '</div>'; 

Change to this code:

 $output .= '<div class="blog_posts_featured_holder">'; $output .= '<div class="blog_posts_featured_image">'; $post_thumb = "[raw]<a href='".$permalink."'><img src='".$image_src."' alt='".get_the_title()."' /></a>[/raw]"; $output .= $post_thumb; $output .= '</div>'; $output .= '<div class="blog_posts_featured_content">'; $output .= '[raw]<strong><a href="'.$permalink.'">'.get_the_title().'</a></strong>[/raw]'; $output .= '<span class="author"><strong>Posted by</strong> <a href="'.get_author_posts_url($post->post_author).'">'.get_the_author().'</a> <strong>on</strong> </span>'; $output .= '<span class="time">'.get_the_time('j').'</span> '; $output .= '<span class="time">'.get_the_time('M').'</span>'; $output .= ','; $output .= '<span class="time"> '.get_the_time('Y').'</span>'; $comment_count = get_comment_count($post->ID); $approved_comment_count = $comment_count['approved']; $output .= '<span class="comments"> with '.$approved_comment_count.' Comments</span>'; $output .= '[raw]<p>'.$post_content.'...</p>[/raw]'; $output .= '</div>'; $output .= '<div class="hr hr-dotted"> </div>'; $output .= '</div>'; 

Then add the following code to the Custom CSS area in Site Options > Styling Options:

 .blog_posts_featured_holder .author, .blog_posts_featured_holder .time, .blog_posts_featured_holder .comments  {font-family:Georgia;font-style:italic;font-size:12px;line-height:30px;} .blog_posts_featured_holder p  {margin-bottom:0px !important;} 

(click screenshots for full-size view)