Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add sequential lesson numbers to [uo_dashboard] shortcode
/**
* By default, the Uncanny Owl Toolkit's [uo_dashboard] shortcode does not apply
* lesson numbers to its output. This code will add lesson numbers via CSS.
*
* These styles should be copied & pasted to a child theme or the "Additional CSS"
* area of the WordPress Customizer. They will add sequential numbers to all lessons
* that are displayed via the Uncanny Owl [uo_dashboard] shortcode.
*
* Feel free to remove the period (.) after the number, adjust the margin,
* or add additional custom styles.
*
* .learndash.dashboard is needed to target the [uo_dashboard] shortcode output only.
*
* Add Topic Numbers --> https://gist.github.com/davewarfel/855691835350e06252fca5e32ebd6e66
*/
/**
* LEARNDASH 3.0
* Only works for those running the LearnDash 3.0 active template.
*/
.ultp-dashboard-lessons {
counter-reset: uo-dash-lessons;
}
.ultp-dashboard-lesson__name a::before {
counter-increment: uo-dash-lessons;
content: counter(uo-dash-lessons) ". ";
}
/**
* LEARNDASH LEGACY
* Only works for those running the LearnDash Legacy active template, or LearnDash 2.x.
*/
.learndash.dashboard #course_list > div > h4 {
counter-reset: lesson-counter;
}
.learndash.dashboard #learndash_lessons h4 > a:before {
counter-increment: lesson-counter;
content: counter(lesson-counter) ".";
margin-right: 5px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment