Home › Forums › Pro Themes › Education Hub Pro › Woothemes Sensei Integration
- This topic has 10 replies, 2 voices, and was last updated 8 years, 7 months ago by wensolutions.
-
AuthorPosts
-
April 11, 2016 at 12:53 pm #5372gedbrockieParticipant
Hi, I was using the free Customizr theme for around one and a half years. I needed to change themes for various reasons. After a long time of searching, I finally picked Education Hub, then bought the Education Hub Pro theme…quite simply, it’s outstanding.
My problem is this, my website uses Woothemes Sensei plugin to deliver the lessons, however, now that I have installed Education Hub Pro, some of the integration is not as it should be. The Woothemes side bars are not showing up on the course and lesson pages, and the side bars that are on the front page are showing up underneath the lesson pages in an odd way.
Also, I tried to create a child theme, however, when I did this, the child theme was from the free version of the theme, not the paid version?!
I have put below the coding that was used for the customizr theme to make it work with Woothemes Sensei plugin, would you be able to alter this so things work correctly with Education Hub Pro?
Thanks for a great theme btw!!, It’s truly excellent.
Ged
<?php
/**
/*********************
* Sensei Integration
*********************//**
* Declare that your theme now supports Sensei
*/
add_action( ‘after_setup_theme’,’customizr_sensei_support’ );
function customizr_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 customizr custom Sensei content wrappers
*/
add_action(‘sensei_before_main_content’,’customizr_sensei_wrapper_start’, 10);
add_action(‘sensei_after_main_content’,’customizr_sensei_wrapper_end’, 10);function customizr_sensei_wrapper_start (){
do_action( ‘__before_main_wrapper’ ); ##hook of the header with get_header
?><div id=”main-wrapper” class=”<?php echo apply_filters( ‘tc_main_wrapper_classes’ , ‘container’ ) ?>”>
<?php do_action( ‘__before_main_container’); ?>
<div class=”container” role=”main”>
<div class=”<?php echo apply_filters( ‘tc_column_content_wrapper_classes’ , ‘row column-content-wrapper’ ) ?>”>
<?php do_action( ‘__before_article_container’); ##hook of left sidebar?>
<div id=”content” class=”<?php echo tc__f( ‘__screen_layout’ , tc__f ( ‘__ID’ ) , ‘class’ ) ?> article-container”>
<?php do_action (‘__before_loop’);##hooks the heading of the list of post : archive, search… ?>
<?php
}function customizr_sensei_wrapper_end (){
echo ‘</div> <!– end #content–>’;
echo ‘</div> <!– end .row–>’;
echo ‘</div> <!– end .container–>’;
echo ‘</div> <!– end #main-wrapper–>’;
}/**
* 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 customizr title:
*/
add_action( ‘sensei_course_single_title’, ‘customizr_single_title’, 10 );
add_action( ‘sensei_lesson_single_title’, ‘customizr_single_title’, 10 );
add_action( ‘sensei_quiz_single_title’, ‘customizr_single_title’, 10 );
add_action( ‘sensei_message_single_title’, ‘customizr_single_title’ , 10 );function customizr_single_title() {
?>
<header class=”entry-header”>
<h1 class=”entry-title “><?php the_title(); ?> </h1>
<hr class=”featurette-divider __before_content”>
</header>
<?php
}/***************************
* // END Sensei Integration
****************************/April 11, 2016 at 1:14 pm #5373wensolutionsKeymaster@GedBrockie, thank you for the appreciation of the theme.
Is it possible to share us your site URL so that we can look at it to be more clear on this issue ?
Sorry asking this again, could you please make it more simple and precise on which section and/or page in your site you are having a problem and need our help ?
April 11, 2016 at 1:41 pm #5374gedbrockieParticipantHi thanks for getting back so quickly.
1. In this first example, if you go down to the bottom of the page, you can see that the primary sidebar is still showing and is also out of place. It really just shouldn’t show.
http://www.guitarandmusicinstitute.com/course/quick-start-beginners-guitar/
2. In this example within the course lessons, there should be a woothemes sidebar which shows all the lessons on the right, currently there is nothing. The above code I gave from my previous theme installation ensured that these were visible.
http://www.guitarandmusicinstitute.com/lesson/lesson-1-the-anatomy-of-the-guitar/
Your theme renders everything else beautifully, I just want to have a better integration with the woothemes sides bars for the course for my students.
Thanks
April 12, 2016 at 2:47 am #5412wensolutionsKeymasterHello @GedBrockie,
The theme needs some customization to support the sensei plugin. For this you need to create a child theme. Here are some guides in case you haven’t made one before:
Turtorial 1
Tutorial 2Basically, you need two files style.css and functions.php to create a child theme. After activating child theme, paste the following additional code inside functions.php:
add_action( 'after_setup_theme', 'declare_sensei_support' ); function declare_sensei_support() { add_theme_support( 'sensei' ); } 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_action('sensei_before_main_content', 'my_theme_wrapper_start', 10); add_action('sensei_after_main_content', 'my_theme_wrapper_end', 10); function my_theme_wrapper_start() { echo '<div id="primary" class="content-area"><main id="main" class="site-main" role="main">'; } function my_theme_wrapper_end() { echo '</main><!-- #main --> </div><!-- #primary -->'; <?php /** * Hook - education_hub_action_sidebar. * * @hooked: education_hub_add_sidebar - 10 */ do_action( 'education_hub_action_sidebar' ); ?> }
Next, navigate to Posts-> Edit from your admin panel. Under Sidebar Settings choose Extra Sidebar 1 as Primary Location. Click Update to save the settings. Repeat this process for all of your posts.
Then go to Appearance-> Widgets-> Place/Move the Sensei Widget to Extra Sidebar 1 Widget Area.This should be the trick to show the course lessons on Extra Sidebar Area and remove the other sidebar from the bottom area too.
Best Regards.
April 12, 2016 at 12:54 pm #5486gedbrockieParticipantGuys, thanks so much for this and taking the time to help me. I am slowly getting there.
Sadly, I’m not a programmer…I have now got a child theme up and running after a bit of bother but:
1. The site seems to crash when I change the phone number and email in the customise area. Only a restart on Apache at the server level gets it up and running again. What could I have done wrong on this?
2. The functions.php file…where and exactly how do I insert the above code? I have the following in my functions.php file
<?php
/**
add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_styles’ );function enqueue_parent_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
}//*
April 12, 2016 at 2:19 pm #5493wensolutionsKeymaster@GedBrockie, you are in the right track after Child Theme set up.
Regarding, site crash after changing email and phone number in customizer sounds quite weird as we don’t think this could hit hard on the whole site. Probably, if you could show us the screenshot anytime if it repeat again would help us to debug it for you.
Next thing, yes of course you can paste all the custom Sensei code just below the existing code that you have in your child theme’s functions.php file.
This should be running without any error as long as you paste it carefully.
Let us know if you run into any problem.
Thanks
April 12, 2016 at 2:51 pm #5497gedbrockieParticipantWell, I don’t know what I am doing wrong, very frustrating. I take the code that you gave me and paste it in to the fuctions.php file that I detailed above.
As soon as I upload it….the site goes down. Take the above code out, and it reappears again….
Any ideas?
Ged
April 12, 2016 at 2:53 pm #5498gedbrockieParticipantps how do I attach images to these support forums?
April 12, 2016 at 11:39 pm #5503wensolutionsKeymasterHi, your functions.php file should look like this with all code above.
<?php add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); function enqueue_parent_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); } add_action( 'after_setup_theme', 'declare_sensei_support' ); function declare_sensei_support() { add_theme_support( 'sensei' ); } 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_action('sensei_before_main_content', 'my_theme_wrapper_start', 10); add_action('sensei_after_main_content', 'my_theme_wrapper_end', 10); function my_theme_wrapper_start() { echo '<div id="primary" class="content-area"><main id="main" class="site-main" role="main">'; } function my_theme_wrapper_end() { echo '</main><!-- #main --> </div><!-- #primary -->'; /** * Hook - education_hub_action_sidebar. * * @hooked: education_hub_add_sidebar - 10 */ do_action( 'education_hub_action_sidebar' ); }
To insert image you can paste your screenshot link here with your post.
Thanks
April 13, 2016 at 11:34 am #5526gedbrockieParticipantGuys, it’s all working great now. Didn’t need to do the later stuff as all was well. There was a slight problem with one of the characters above as they were being encoded?…anyway, that’s been done and the site looks amazing.
Thanks once again for your fantastic work and theme which has really going to contribute to GMI’s continued success.
Best
Ged
April 13, 2016 at 12:02 pm #5528wensolutionsKeymasterReally very glad to hear it and just checked your site which looks really awesome with great contents!!
All the best wishes for your business.
Regards,
Support Team
WEN Solutions -
AuthorPosts
- You must be logged in to reply to this topic.