Skip to content

Snippet: Override the Blog Grid Element Date with the Full Meta (date, author, comments, etc)

Important: Rather then customizing elements like the Blog Grid we would highly recommend instead using the Post Cards element and either using one of the preset card styles or creating your own custom card.

This snippet allows you to modify the date display for the Blog Grid element so that it displays the post meta instead of the date.

/**
 * Override the blog grid element date to display the post entry meta instead.
 *
 * @link https://total.wpexplorer.com/docs/snippets/blog-grid-date-convert-meta/
 */
add_filter( 'vcex_blog_grid_date', function( $date, $shortcode_attributes ) {
    ob_start();
        if ( function_exists( 'wpex_get_template_part' ) ) {
            wpex_get_template_part( 'blog_single_meta' );
        }
    return ob_get_clean();
}, 10, 2 );
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