Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davewarfel/e9a7b76fc89f00656d90a721eb9bf079 to your computer and use it in GitHub Desktop.
Save davewarfel/e9a7b76fc89f00656d90a721eb9bf079 to your computer and use it in GitHub Desktop.
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