The Enhanced Course Grid module is part of the Pro Suite of modules for the Uncanny LearnDash Toolkit. It’s much like the Course Grid add-on for LearnDash, except that it’s intended more for signed-in users and adds a lot of flexibility to how courses are displayed in the grid.
The course grid can be added to any page using a shortcode or block. Out of the box, it will display a nice 4-column grid of courses (featured images of equal sizes should be added to courses) that are listed in a single row but expandable to display all available courses.
For signed in users, courses are ordered by:
- Enrolled courses – Courses that the user is enrolled in, in descending order by percent complete. Completed courses are displayed last
- Not enrolled courses – Available courses that the user isn’t enrolled in
- “Coming Soon” tag – Courses that have a “coming soon” tag. This feature adds a way to list courses that will be added at a later date and to flag them as such. Note that this tag must be applied under Tags (standard WordPress tags) and not Course Tags (LearnDash-specific tags).
The default grid view has 4 columns including the View More button. Each course includes a featured image as shown in the screenshot below.
Course descriptions can also be optionally included in the grid. Descriptions are set at the course level using the Short Description field on the Edit Course page and, when populated, are displayed beneath the course name in the grid element. The field also supports HTML code. Note: When using HTML in the Short Description field, the LearnDash Course Grid plugin should be disabled as it removes HTML from the field.
Block Name: Enhanced Course Grid
The [uo_courses] shortcode/block includes a lot of available attributes to keep things as flexible as possible. It’s helpful to watch the screencast above before getting started as it demonstrates how each of the attributes works and the impact to the course grid. Here’s a list of the attributes that are currently available:
|Attribute Name||Description||Attribute Values||Default Value|
|category||Shows only courses in one or several categories. This is a great way to organize courses into a fourth hierarchical level (beyond courses, lessons and topics).||"all" or a category slug; multiple category slugs can be separated by comma||"all"|
(Lower case ld as in learndash)
|Shows only courses in one or several course categories. This is a great way to organize courses into a fourth hierarchical level (beyond courses, lessons and topics).||"all" or a course category slug; multiple category slugs can be separated by comma||"all"|
|category_selector||Show a drop-down list above the grid to allow filtering courses by WordPress category (not LearnDash category).|
Categories that do not contain any courses are not displayed.
|"show" or "hide"||"hide"|
|course_categoryselector||Show a drop-down list above the grid to allow filtering courses by LearnDash course category (not WordPress category).|
Course categories that do not contain any courses are not displayed.
|"show" or "hide"||"hide"|
|enrolled_only||Shows only courses that the user is enrolled in.||"yes" or "no"||"no"|
|not_enrolled||Shows only courses that the user is not enrolled in. This is useful when you want to show a list of available courses that the user hasn't yet purchased.||"yes" or "no"||"no"|
|cols||Sets the number of columns to display per row.||"1", "2", "3", "4", or "5"||"4"|
|limit||Sets the number of courses to display in front of the View More button. If set to "all", the View More button does not appear.||"all" or any integer||"4"|
|hide_view_more||Hides the View More button.||"yes" or "no"||"no"|
|hide_description||Hides Course Description.||"yes" or "no"||"no"|
|hide_progress||Hide the progress bar for the user; this can improve performance on sites with many courses||"yes" or "no"||"no"|
|hide_credits||Hides the assigned credit value of the course||"yes" or "no"||"no"|
|hide_title||Hides the course title||"yes" or "no"||"no"|
|more||Directs the user to a page instead of expanding the list of courses when the View More button is clicked.||a URL|
|show_image||Controls whether or not course featured images are displayed. If no featured images are set for courses, this should be "no". Note when uploading a featured image, WordPress will automatically crop it to 1.33:1 aspect ratio. The image you upload should be at least 624 x 468 pixels.||"yes" or "no"||"yes"|
|price||Sets whether or not the price and price banner are displayed in the upper left corner of courses. If the grid is used on a page accessible to registered users only, prices may not be appropriate. Also note that Closed courses with no price listed will be labelled as "Free", which may be incorrect.||"yes" or "no"||"yes"|
|link_to_course||Determines whether or not clicking a grid item should take the user to the associated course page. While generally this should stay as "yes", on public-facing pages it may be useful to have a list of courses that aren't linked.||"yes" or "no"||"yes"|
|default_sorting||Sorts courses by their status. For example, if default_sorting is set to "course-progress,enrolled,not-enrolled,completed,coming-soon", courses that are in progress will be listed first whereas courses that are not yet available for enrollment will be last. If you set custom default_sorting and exclude any values/categories will be excluded. In other words, if you set default_sorting="completed", ONLY completed courses will be shown.||"course-progress,enrolled,not-enrolled,coming-soon,completed" (in any order)||"course-progress,enrolled,not-enrolled,coming-soon,completed"|
|orderby||Sets whether courses should be ordered by title, date, or menu order.||"title", "date", or "menu_order"||"title"|
|order||Controls whether courses should be listed in ascending or descending order based on what's set in the order_by attribute.||"asc" or "desc"||"asc"|
|ignore_default_sorting||Controls whether the default_sorting order should be ignored. By default, default_sorting takes precedence over orderby, i.e., courses will be sorted by their status, and then by "date", "title", or "menu_order". When ignore_default_sorting is set to "yes", all courses will be ordered by the orderby value regardless of what's set in default_sorting.||"yes" or "no"||"no"|
|start_course_button||Show a Start button beneath the course. Visible only if the user is enrolled and progress is 0%.||"show" or "hide"||"hide"|
|resume_course_button||Show a Resume button beneath the course. Visible only if the user is enrolled and has progress. The Resume module MUST be enabled for this to work and the button will only be visible if users have progress reported after installing version 2.5 of this plugin.||"show" or "hide"||"hide|
|border_hover||Changes the border colour of grid items when they are hovered over.|
|view_more_color||Changes the fill colour of the View More button.|
|view_more_hover||Changes the fill colour of the View More button when it is hovered over.|
|view_more_text_color||Changes the text colour of the View More button.|
|view_more_text||Changes the text label of the View More button.|
|view_less_text||Changes the text label of the View Less button.|
Let’s take a look at an example of how you might customize the course grid. Suppose that you want to show a course grid on a Learner Dashboard which only displays courses that the user is enrolled in. You also want to first list the courses that they have started, followed by those they have yet to begin, and then by those they have completed. You also want to list courses in alphabetical order (the default). In this example, you only want to show courses that the user is taking or has taken. Price is no longer relevant so you would hide it. Your shortcode will look like this:
[uo_courses enrolled_only="yes" price="no" default_sorting="course-progress,enrolled,completed"]
Using CSS to Customize the Course Grid
You can customize the grid layout directly in a CSS file by copying the following file:
Move it to your child theme so that it’s available at:
Filters for developers
To change the text in the ribbon displayed on the top left of each grid element there are two filters available:
apply_filters( 'uo_course_grid_ribbon_text', $course_price_type, $course->ID )
apply_filters( 'uo_course_grid_ribbon_price', $course_price, $course->ID )
Overriding the Course Grid template
Update: As of Uncanny LearnDash Toolkit Pro version 3.1, you can edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named /uncanny-toolkit/, keeping the same file structure but removing the /templates/ subdirectory.
For example, to override the course grid template, copy:
The copied file will now override the default template in the Uncanny Toolkit.
Warning: Do not edit these files within the the Uncanny Toolkit plugin itself, as they are overwritten during the upgrade process and any customizations will be lost.