Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(For LearnDash 2.x. Does not work with LearnDash 3.0+.) Auto-Expand Lessons in LearnDash Course Navigation Widget
/**
* This code will do two things:
*
* 1. Expand the topics (beneath each lesson) in the LearnDash
* course navigation widget.
*
* 2. Hide the arrow that allows lessons to be expanded/collapsed.
*
* NOTE: Be careful using this if you have a large number of lessons and/or topics.
* It could make for a REALLY long sidebar.
*
* These styles should be copied & pasted to a child theme or the "Additional CSS"
* area of the WordPress Customizer.
*
*/
/* Hide the flippable arrow */
.learndash_navigation_lesson_topics_list>div>.list_arrow.flippable,
.learndash_navigation_lesson_topics_list>div>.list_arrow.collapse {
display: none;
}
/* Show all topics beneath each lesson */
.learndash_navigation_lesson_topics_list .learndash_topic_widget_list {
display: block !important;
/* !important is needed bc LD adds inline display styles */
}
@Cdanso

This comment has been minimized.

Copy link

@Cdanso Cdanso commented Mar 31, 2021

The course content still opens collapsed after adding the code to the "Additional CSS" section of the WP customizer. What else can be done?

@davewarfel

This comment has been minimized.

Copy link
Owner Author

@davewarfel davewarfel commented Mar 31, 2021

I'm guessing you're using the "LearnDash 3.0" active template in the LearnDash settings. This code only works with LearnDash versions before 3.0.

The CSS is different for LearnDash 3.0 and above. Alternatively, you could use a premium plugin I developed that offers this feature, along with 100 other customization options.

https://escapecreative.com/products/design-upgrade-learndash/

@Cdanso

This comment has been minimized.

Copy link

@Cdanso Cdanso commented Mar 31, 2021

Yes, I'm using the 3.0. Alright, will check your plugin out. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment