Created
March 26, 2015 03:18
-
-
Save woogist/b88f1a0f0ef1e8e31c88 to your computer and use it in GitHub Desktop.
Sensei integration for our Storefront theme. Add the code below to your child themes functions.php file.
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
/********************* | |
* Sensei Integration | |
*********************/ | |
/** | |
* Declare that your theme now supports Sensei | |
*/ | |
add_action( 'after_setup_theme','storefront_sensei_support' ); | |
function storefront_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 The storefront custom Sensei content wrappers | |
*/ | |
add_action('sensei_before_main_content','storefront_sensei_wrapper_start', 10); | |
add_action('sensei_after_main_content','storefront_sensei_wrapper_end', 10); | |
function storefront_sensei_wrapper_start (){ | |
echo '<div id="primary" class="content-area">'; | |
echo '<div id="main" class="site-main" role="main">'; | |
} | |
function storefront_sensei_wrapper_end (){ | |
echo'</div> <!-- end #main -->'; | |
echo'</div> <!-- end #primary -->'; | |
get_sidebar(); | |
} | |
/*************************** | |
* // END Sensei Integration | |
****************************/ |
I had the same issue like the example from @BurlesonBrad.
When I add the snippet into the functions.php file of my blank child theme, there is a big empty space on the right side of the page "Courses".
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just had (yet) another user point out that this doc should probably be modified:
https://docs.woocommerce.com/document/woothemes-storefront/
Here lemme fire it up on mine and recreate the problem, ready?
Course page without this snippet ---> http://prntscr.com/c6jycf
Course page WITH this snippet added ----> http://prntscr.com/c6jzyg