Created
March 18, 2016 22:05
-
-
Save QROkes/a6bb16224b1b5456f874 to your computer and use it in GitHub Desktop.
Genesis Simple Sidebars for Custom Post Types (WordPress + Genesis Framework)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_before_sidebar_widget_area', 'qr_remove_default_sidebar' ); | |
function qr_remove_default_sidebar() { | |
if ( get_post_type() == 'my-cpt' ) { // set CPT here | |
remove_action( 'genesis_sidebar', 'ss_do_sidebar' ); | |
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); | |
add_action( 'genesis_sidebar', 'qr_add_cpt_sidebar' ); | |
} | |
} | |
function qr_add_cpt_sidebar() { | |
dynamic_sidebar( 'my-sidebar' ); // set the simple sidebar here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment