Use a div for post info in Genesis

The “Genesis Post Info” displays the post date, author, and comment count above the post content. You can modify this content using the genesis_post_info filter.

The output is all wrapped in a paragraph –  <p class="entry-meta"> – inside the post’s <header>. You can modify this markup using the Genesis Markup API.

The code below changes the paragraph into a div: <div class="entry-meta">

/**
 * Use a div for post-info, open
 *
 * @author Bill Erickson
 * @link https://www.billerickson.net/code/genesis-post-info-markup
 *
 */
function be_post_info_markup_open( $open, $args ) {
	return sprintf( '<div %s>', genesis_attr( $args['context'], array(), $args ) );
}
add_filter( 'genesis_markup_entry-meta-before-content_open', 'be_post_info_markup_open', 10, 2 );
/**
 * Use a div for post-info, close
 *
 * @author Bill Erickson
 * @link https://www.billerickson.net/code/genesis-post-info-markup
 *
 */
function be_post_info_markup_close( $close, $args ) {
	return '</div>';
}
add_filter( 'genesis_markup_entry-meta-before-content_close', 'be_post_info_markup_close', 10, 2 );

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk