Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save davewarfel/855691835350e06252fca5e32ebd6e66 to your computer and use it in GitHub Desktop.

Select an option

Save davewarfel/855691835350e06252fca5e32ebd6e66 to your computer and use it in GitHub Desktop.

Revisions

  1. davewarfel revised this gist Dec 25, 2019. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion learndash-uo-dashboard-shortcode-topic-numbers.css
    Original file line number Diff line number Diff line change
    @@ -23,10 +23,19 @@
    * .learndash.dashboard is needed to target the [uo_dashboard] shortcode output only.
    */

    /* LEARNDASH 3.0 */
    .ultp-dashboard-lesson__topics {
    counter-reset: uo-dash-topics;
    }
    .ultp-dashboard-topic__name a::before {
    counter-increment: uo-dash-topics;
    content: counter(uo-dash-lessons) "." counter(uo-dash-topics) " ";
    }

    /* LEARNDASH LEGACY */
    .learndash.dashboard #learndash_lesson_topics_list {
    counter-reset: topic-counter;
    }

    .learndash.dashboard #learndash_lesson_topics_list .topic_item span:before {
    counter-increment: topic-counter;
    content: counter(lesson-counter) "." counter(topic-counter);
  2. davewarfel revised this gist Jul 21, 2018. No changes.
  3. davewarfel created this gist Jul 2, 2018.
    34 changes: 34 additions & 0 deletions learndash-uo-dashboard-shortcode-topic-numbers.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    /**
    * By default, the Uncanny Owl Toolkit's [uo_dashboard] shortcode does not apply
    * topic numbers to its output. This code will add topic 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 topics
    * that are displayed via the Uncanny Owl [uo_dashboard] shortcode.
    *
    * This works best when also using lesson numbers. This will create the following structure:
    *
    * 1. Lesson 1
    * 1.1 Topic 1
    * 1.2 Topic 2
    * 1.3 Topic 3
    * 2. Lesson 2
    *
    * ...and so on.
    *
    * Add Lesson Numbers --> https://gist.github.com/davewarfel/e9a7b76fc89f00656d90a721eb9bf079
    *
    * Feel free to adjust the margin or add additional custom styles.
    *
    * .learndash.dashboard is needed to target the [uo_dashboard] shortcode output only.
    */

    .learndash.dashboard #learndash_lesson_topics_list {
    counter-reset: topic-counter;
    }

    .learndash.dashboard #learndash_lesson_topics_list .topic_item span:before {
    counter-increment: topic-counter;
    content: counter(lesson-counter) "." counter(topic-counter);
    margin-right: 5px;
    }