Skip to content

Instantly share code, notes, and snippets.

@generatepress
Last active May 16, 2017 21:53
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 generatepress/d34e913acad534ffaa16 to your computer and use it in GitHub Desktop.
Save generatepress/d34e913acad534ffaa16 to your computer and use it in GitHub Desktop.
Integrate GP with Sensei
add_action( 'after_setup_theme','generate_remove_sensei_default' );
function generate_remove_sensei_default()
{
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_theme_support( 'sensei' );
}
add_action('sensei_before_main_content', 'generate_sensei_wrapper_start', 10);
add_action('sensei_after_main_content', 'generate_sensei_wrapper_end', 10);
function generate_sensei_wrapper_start() {
?>
<div id="primary" <?php generate_content_class();?>>
<main id="main" <?php generate_main_class(); ?> itemprop="mainContentOfPage" role="main">
<?php do_action('generate_before_main_content'); ?>
<?php }
function generate_sensei_wrapper_end() {
do_action('generate_after_main_content');
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
do_action('generate_sidebars');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment