Display Posts Shortcode – Change Date Format

Default date format in the Display Posts Shortcode plugin is hard coded in the plugin but it can be changed using a filter.

By default the date format is (8/29/15) which is useless for countries other than the USA.

The following function can be placed in the THEME/functions.php file to change the format so that the date looks like September 28, 2015

function be_display_posts_date( $output, $atts, $image, $title, $date, $excerpt, $inner_wrapper ) {
	// Date format
	if ( $atts['include_date'] ) $date = ' <span class="date">'. get_the_date('F j, Y') .'</span>';
	else $date = '';
	$output = '<' . $inner_wrapper . ' class="listing-item">' . $image . $title . $date . $excerpt . '</' . $inner_wrapper . '>';
return $output;

add_filter( 'display_posts_shortcode_output', 'be_display_posts_date', 10, 7 );

Original function author is Bill Erickson and the full article can be found here:

Display Posts Shortcode Plugin can be found here: