Skip to content

Instantly share code, notes, and snippets.

@SriniBlog
Last active December 25, 2015 12:26
Show Gist options
  • Save SriniBlog/b1b80e60c192a588a76b to your computer and use it in GitHub Desktop.
Save SriniBlog/b1b80e60c192a588a76b to your computer and use it in GitHub Desktop.
This code snippet is used to create the custom author box in wordpress using genesis framework.
//Add the below code in functions.php
/*************** AUTHOR BOX **********************/
/**
* STEP 1: Create Custom Author Widget
*
*/
genesis_register_sidebar( array(
'id' => 'authorbox',
'name' => __( 'Author Box', 'sb' ),
'description' => __( 'This is displayed on end of every post only.', 'sb' ),
) );
/**
* STEP 2: How to add the Widget at end of the Post
*
*/
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
add_action( 'genesis_after_entry', 'sb_authorbox_genesis', 8 );
function sb_authorbox_genesis() {
if ( is_singular( 'post' ) ) {
genesis_widget_area( 'authorbox', array(
'before' => '<div class="author-box">',
'after' => '</div><!-- end #authorbox -->',
) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment