• Resolved aqeelahmed

    (@aqeelahmed)


    A user previously had the same query as me here.

    Basically, in the user’s “Registered Course” page, LearnDash courses are not being listed in order of their date. Instead, they’re being listed in the order they’ve been created, even if the date is changed later.

    How can we list the LearnDash courses in order of their dates in ascending order?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author BuddyBoss

    (@buddyboss)

    Hi @aqeelahmed

    order: sets the order of courses. Possible values: DESC, ASC.
    Example: [ld_course_list order=”ASC”]
    shows courses in ascending order.

    Example: [ld_course_list order=”ASC” orderby=”title”]
    shows courses in ascending order by title.

    Example: [ld_course_list order=”ASC” orderby=”title”]
    shows courses in ascending order by title.

    Thread Starter aqeelahmed

    (@aqeelahmed)

    Thanks for your quick response. However, your instructions are for if I created my own “All Courses” page.

    My query is in relation to the “Registered Course” page linked to the User’s profile found at /members/[user]/courses

    I believe it to be something that needs changing or adding in /plugins/buddypress-learndash/templates/courses.php

    Here are screenshots: https://imgur.com/a/W5K8I

    Thanks for your help!

    Plugin Author BuddyBoss

    (@buddyboss)

    Hi @aqeelahmed
    Paste this custom code block in your theme’s functions.php to sort courses by date.

    add_filter( 'bp_learndash_user_courses_atts', 'learndash_course_orderby_date', 10, 1 );
    
    function learndash_course_orderby_date( $atts ) {
     $atts['orderby']    = 'date';
     $atts['order']      = 'ASC';
     return $atts;
    }
    Thread Starter aqeelahmed

    (@aqeelahmed)

    That did the job! You are the best!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sort Courses by Date’ is closed to new replies.