askdesign
7/5/2017 - 5:04 PM

How to Add After Post Widget Area in Genesis 2.0 Framework- WordPress Tips

Last updated on May 12th, 2017 by App Shah

/** STEP 1 - Add the after post section */
genesis_register_sidebar( array(
	'id'		=> 'afterpost',
	'name'		=> __( 'After Post  Widget', 'child theme' ),
	'description'	=> __( 'This is the after post section.', 'child theme' ),
) );
 
/** STEP 2 - Add Hook to show widgets after Post Section. */
add_action( 'genesis_entry_footer', 'custom_add_after_post_box', 15 );
function custom_add_after_post_box() {
	if ( is_singular( 'post' ) )
	genesis_widget_area( 'afterpost', array(
		'before' => '<div id="afterpost">',
		 'after'	 => '</div>',
	) );
}

/** NOTE: I added the 'after' div in step 2 */