Skip to content

Snippet: Display Modified Date in Post Types Grid

This snippet will override the default published date for the Total Post Types Grid builder block to instead display the last modified date.

add_filter( 'vcex_post_type_grid_date_inner', function( $date ) {
	if ( get_the_date( 'U' ) !== get_the_modified_date( 'U' ) ) {
		$date = 'Last updated on ' . get_the_modified_date( get_option( 'date_format' ) );
	}
	return $date;
}, 10 );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top