Created
April 8, 2015 16:41
-
-
Save woogist/81335471149e6134133d to your computer and use it in GitHub Desktop.
This code integrates Zurb FoundationPress theme from Ole Fredrik ( http://foundationpress.olefredrik.com ) with the Sensei LMS by Woothemes. To add this integration simply copy this cod to your 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','foundationpress_sensei_support' ); | |
function foundationpress_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 FoundationPress custom Sensei content wrappers | |
*/ | |
add_action('sensei_before_main_content','foundationpress_sensei_wrapper_start', 10); | |
add_action('sensei_after_main_content','foundationpress_sensei_wrapper_end', 10); | |
function foundationpress_sensei_wrapper_start (){ | |
echo '<div class="row"><div class="small-12 large-8 columns" role="main">'; | |
} | |
function foundationpress_sensei_wrapper_end (){ | |
echo'</div> <!-- end role main-->'; | |
get_sidebar(); | |
echo '</div> <!-- div.row-->'; | |
} | |
/** | |
* remove default sensei titles | |
*/ | |
global $woothemes_sensei; | |
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 ); | |
/** | |
* Add custom foundationpress title: | |
*/ | |
add_action( 'sensei_course_single_title', 'foundationpress_single_title', 10 ); | |
add_action( 'sensei_lesson_single_title', 'foundationpress_single_title', 10 ); | |
add_action( 'sensei_quiz_single_title', 'foundationpress_single_title', 10 ); | |
add_action( 'sensei_message_single_title', 'foundationpress_single_title' , 10 ); | |
function foundationpress_single_title() { | |
?> | |
<header class="entry-header"> | |
<h1 class="entry-title "><?php the_title(); ?> </h1> | |
</header> | |
<?php | |
} | |
/*************************** | |
* // END Sensei Integration | |
****************************/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment