Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/5560766 to your computer and use it in GitHub Desktop.
Save braddalton/5560766 to your computer and use it in GitHub Desktop.
// Register Custom Widget
genesis_register_sidebar( array(
'id' => 'custom-widget',
'name' => __( 'Custom Widget', 'wpsitesdotnet' ),
'description' => __( 'Displays Custom Widget Content Home On Page Using Portfolio Custom Post Type', 'wpsitesdotnet' ),
) );
// Hook In Custom Widget
add_action( 'genesis_before_content', 'wpsites_custom_widget', 9 );
/**
* @author Brad Dalton
* @link http://wpsites.net/
*/
function wpsites_custom_widget() {
if ( is_page_template('page_portfolio.php') ) {
echo '<div class="custom-widget"><div class="wrap">';
dynamic_sidebar( 'custom-widget' );
echo '</div></div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment