Last active
August 29, 2015 14:16
-
-
Save woogist/e1d46b185db807fc52c4 to your computer and use it in GitHub Desktop.
Sensei integration for The 7 theme from Dream Themes. Add the code below into your themes functions.php. This will only work for The 7 them from Dream Themes
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','the_7_sensei_support' ); | |
function the_7_sensei_support () { | |
add_theme_support( 'sensei' ); | |
} | |
/** | |
* remove default sensei titles | |
*/ | |
remove_action( 'sensei_course_single_title', array( $woothemes_sensei->frontend , 'sensei_single_title' ), 10 ); | |
remove_action( 'sensei_lesson_single_title', array( $woothemes_sensei->frontend , 'sensei_single_title' ), 10 ); | |
remove_action( 'sensei_quiz_single_title', array( $woothemes_sensei->frontend, 'sensei_single_title' ), 10 ); | |
remove_action( 'sensei_message_single_title', array( $woothemes_sensei->frontend, 'sensei_single_title' ), 10 ); | |
/** | |
* Do the themes default header operations | |
*/ | |
add_action( 'get_header', 'the_7_header_setup' ); | |
function the_7_header_setup(){ | |
if( is_singular( 'lesson' ) || is_singular( 'course' ) | |
|| is_singular( 'quiz' ) || is_singular( 'message' ) ){ | |
$config = Presscore_Config::get_instance(); | |
$config->set('template', 'page'); | |
presscore_config_base_init(); | |
} | |
} | |
/** | |
* 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 The 7 custom Sensei content wrappers | |
*/ | |
add_action('sensei_before_main_content','the_7_sensei_wrapper_start', 10); | |
add_action('sensei_after_main_content','the_7_sensei_wrapper_end', 10); | |
function the_7_sensei_wrapper_start (){ | |
echo '<div id="content" class="content" role="main">'; | |
} | |
function the_7_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