Last active
December 20, 2017 01:51
-
-
Save woogist/948b55dae08434360598 to your computer and use it in GitHub Desktop.
The code in below will integrate Sensei with the Genesis theme framework from Studio Press. Add the code below into your themes functions.php file.
This file contains 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
/********************* | |
* Sensei Integration | |
*********************/ | |
/** | |
* Declare that your theme now supports Sensei | |
*/ | |
add_action( 'after_setup_theme', 'sensei_support' ); | |
function sensei_support() { | |
add_theme_support( 'sensei' ); | |
} | |
/** | |
* Remove the default Sensei wrappers | |
*/ | |
global $woothemes_sensei; | |
remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 ); | |
remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 ); | |
/** | |
* Add Genesis custom Sensei content wrappers | |
*/ | |
add_action('sensei_before_main_content', 'genesis_sensei_wrapper_start', 10); | |
add_action('sensei_after_main_content', 'genesis_sensei_wrapper_end', 10); | |
function genesis_sensei_wrapper_start() { | |
echo '<div class="content-sidebar-wrap"><main class="content" role="main" itemprop="mainContentOfPage">'; | |
} | |
function genesis_sensei_wrapper_end() { | |
echo'</div> <!-- end main-->'; | |
get_sidebar(); | |
echo'</div> <!-- end .content-sidebar-wrap-->'; | |
} | |
/*************************** | |
* // END Sensei Integration | |
****************************/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment