Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LifterLMS Course & Lesson Sidebar Compatibility for the Kapital Theme (http://themeforest.net/item/kapital-responsive-multipurpose-theme/10064359?ref=gocodeBOX)
<?php // don't paste this into your functions.php file
/**
* 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' );
<?php
/**
* Make LifterLMS Courses full width by using the Kapital Theme Page Template
* tested on Kapital 2.6
*/
include trailingslashit( get_template_directory() ) . 'page.php';
<?php
/**
* Make LifterLMS Lessons full width by using the Kapital Theme Page Template
* tested on Kapital 2.6
*/
include trailingslashit( get_template_directory() ) . 'page.php';
<?php
/**
* Make LifterLMS Quizzes full width by using the Kapital Theme Page Template
* tested on Kapital 2.6
*/
include trailingslashit( get_template_directory() ) . 'page.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment