Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Astra Theme wrappers for the WooCommerce sensei
<?php // don't copy this line to your file.
// disable the default wrappers for the WooCommerce Sensei templates.
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 );
/**
* Load the correct wrappers for the WooCommerce Sensei layouts.
*/
function astra_child_sensei_wrapper_start() {
$site_sidebar = astra_page_layout();
if ( 'left-sidebar' == $site_sidebar ) {
get_sidebar();
}
?>
<div id="primary" class="content-area primary">
<?php astra_primary_content_top(); ?>
<main id="main" class="site-main" role="main">
<div class="ast-lifterlms-container">
<?php
}
function astra_child_sensei_wrapper_end() {
?>
</div> <!-- .ast-lifterlms-container -->
</main> <!-- #main -->
<?php astra_primary_content_bottom(); ?>
</div> <!-- #primary -->
<?php
$site_sidebar = astra_page_layout();
if ( 'right-sidebar' == $site_sidebar ) {
get_sidebar();
}
}
add_action('sensei_before_main_content', 'astra_child_sensei_wrapper_start', 10);
add_action('sensei_after_main_content', 'astra_child_sensei_wrapper_end', 10);
/**
* Declare support for the WooCommerce Sensei
*/
function astra_child_declare_sensei_support() {
add_theme_support( 'sensei' );
}
add_action( 'after_setup_theme', 'astra_child_declare_sensei_support' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.