LifterLMS Sidebar not appearing on Compatible theme
-
I’m using LifterLMS on a child theme of the Extra Theme by Elegant Themes (it’s indicated in the documentation that Divi should be compatible with the sidebars without additional registration and Extra is based on the Divi theme). For whatever reason, I can’t get the sidebar to appear on the pages they’re supposed to no matter what I do. I’ve added various code snippets to the functions.php file and I’ve added and enabled the LifterLMS Labs plugin to no avail. I’ve added and removed every arrangement of the following code below:
/** * Display LifterLMS Course and Lesson sidebars * on courses and lessons in place of the sidebar returned by * this function * @param string $id default sidebar id (an empty string) * @return string */ function my_llms_sidebar_function( $id ) { $my_sidebar_id = 'sidebar-main'; // replace this with your theme's sidebar ID return $my_sidebar_id; } add_filter( 'llms_get_theme_default_sidebar', 'my_llms_sidebar_function' ); /** * Declare explicit theme support for LifterLMS course and lesson sidebars * @return void */ function my_llms_theme_support(){ add_theme_support( 'lifterlms-sidebars' ); } add_action( 'after_setup_theme', 'my_llms_theme_support' ); function displaying_sidebar_in_post_types_xtreme( $sidebars_widgets ) { if (is_singular( 'course' ) && array_key_exists( 'llms_course_widgets_side', $sidebars_widgets )) { $sidebars_widgets['primary-widget-area'] = $sidebars_widgets['llms_course_widgets_side']; } elseif (is_singular( 'lesson' ) && array_key_exists( 'llms_lesson_widgets_side', $sidebars_widgets )) { $sidebars_widgets['primary-widget-area'] = $sidebars_widgets['llms_lesson_widgets_side']; } return $sidebars_widgets; } add_filter( 'sidebars_widgets', 'displaying_sidebar_in_post_types_xtreme' );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘LifterLMS Sidebar not appearing on Compatible theme’ is closed to new replies.