Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php // don't add this line to your functions.php file
/**
* 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' );
<?php // don't add this line to your functions.php file
/**
* 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 = 'my-sidebar-id'; // replace this with your theme's sidebar ID
return $my_sidebar_id;
}
add_filter( 'llms_get_theme_default_sidebar', 'my_llms_sidebar_function' );
@mneuschaefer

This comment has been minimized.

Copy link

mneuschaefer commented Oct 11, 2016

semicolon missing in line 13

@thomasplevy

This comment has been minimized.

Copy link
Owner Author

thomasplevy commented Oct 14, 2016

thanks

@cclambie

This comment has been minimized.

Copy link

cclambie commented Nov 16, 2016

Thomas, I suggest you spell out the need for the full words of the # to be in inside the single quotes in
https://gist.github.com/thomasplevy/795fd98f3073e6872fc36f28e30d05ec#file-llms-sidebar-support-php

I just spent 15 minutes trying to figure out why this wasn't working, as I just put '1', instead of 'sidebar-1' in the quotes.
Might help someone in the future.

I suggest updating line 11 to
$my_sidebar_id = 'my-sidebar-id'; // replace this with your theme's sidebar ID eg. 'sidebar-1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.