Kapital Theme Course and Lesson Sidebar Compatibility

Using LifterLMS Labs: Super Sidebars

# Top

As of March 2017, the recommend method for sidebar compatibility is to use LifterLMS Labs: Super Sidebars, a free add-on that allows you to add sidebar compatibility to just about any theme in a matter of seconds without having to write any code. See the full tutorial here.

If you’re using the Kapital theme you’ll want to add the following snippet to your theme or child theme’s functions.php file in order to ensure LifterLMS Course and Lesson sidebars function correctly.

<?php // Don't copy this line!
/**
* LifterLMS Course & Lesson Sidebar Compatibility for the Kapital Theme (http://themeforest.net/item/kapital-responsive-multipurpose-theme/10064359?ref=gocodeBOX)
*
* @since 2016-04-25
*/
/**
* Display lesson and course custom sidebars on the appropriate LifterLMS pages when using the Kapital WordPress Theme
*
* @param array $sidebars_widgets array of registered sidebars
* @return array
*/
function lifterlms_sidebar_compatibility( $sidebars_widgets ) {
// replace the widgets in the primary sidebar with LifterLMS Course sidebar on Course Pages
if ( is_singular( 'course' ) && array_key_exists( 'llms_course_widgets_side', $sidebars_widgets ) ) {
$sidebars_widgets['main-widget-area'] = $sidebars_widgets['llms_course_widgets_side'];
$sidebars_widgets['blog-widget-area'] = $sidebars_widgets['llms_course_widgets_side'];
}
// replace the widgets in the primary sidebar with LifterLMS Lesson sidebar on Lesson Pages
elseif ( is_singular( 'lesson' ) && array_key_exists( 'llms_lesson_widgets_side', $sidebars_widgets ) ) {
$sidebars_widgets['main-widget-area'] = $sidebars_widgets['llms_lesson_widgets_side'];
$sidebars_widgets['blog-widget-area'] = $sidebars_widgets['llms_lesson_widgets_side'];
}
return $sidebars_widgets;
}
add_filter( 'sidebars_widgets', 'lifterlms_sidebar_compatibility' );

This is dependent on having sidebars enabled in your Kapital Theme Settings under “Blog”

For compatibility with other themes, please visit How to make LifterLMS sidebars work on just about any theme.

 

Make Courses, Lessons, and Quizzes Full-Width

# Top

If you’d like to make Courses, Lessons, and Quizzes full width

  1. If you don’t already have a child theme, Create one
  2. Create three new files in your child theme named and add the respective content

single-course.php

<?php // Don't copy this line!
/**
* LifterLMS Course & Lesson Sidebar Compatibility for the Kapital Theme (http://themeforest.net/item/kapital-responsive-multipurpose-theme/10064359?ref=gocodeBOX)
*
* @since 2016-04-25
*/
/**
* Make LifterLMS Courses full width by using the Kapital Theme Page Template
* tested on Kapital 2.6
*/
include trailingslashit( get_template_directory() ) . 'page.php';
view raw single-course.php delivered with ❤ by LifterLMS

single-lesson.php

<?php // Don't copy this line!
/**
* LifterLMS Course & Lesson Sidebar Compatibility for the Kapital Theme (http://themeforest.net/item/kapital-responsive-multipurpose-theme/10064359?ref=gocodeBOX)
*
* @since 2016-04-25
*/
/**
* Make LifterLMS Lessons full width by using the Kapital Theme Page Template
* tested on Kapital 2.6
*/
include trailingslashit( get_template_directory() ) . 'page.php';
view raw single-lesson.php delivered with ❤ by LifterLMS

single-llms_quiz.php

<?php // Don't copy this line!
/**
* LifterLMS Course & Lesson Sidebar Compatibility for the Kapital Theme (http://themeforest.net/item/kapital-responsive-multipurpose-theme/10064359?ref=gocodeBOX)
*
* @since 2016-04-25
*/
/**
* Make LifterLMS Quizzes full width by using the Kapital Theme Page Template
* tested on Kapital 2.6
*/
include trailingslashit( get_template_directory() ) . 'page.php';

Last Updated on
Was this article helpful?