Introduction
This list of shortcodes was created for users of our Uncanny LP LearnDash system to provide easy access to available LearnDash shortcodes. While other LearnDash users can use the shortcodes listed in the Course and Certificate sections, please note that all shortcodes in the Group Shortcodes section require our Uncanny LearnDash Groups plugin on sites that are not using our LP product.
Course Shortcodes
Shortcode & Attribute | Description |
---|---|
[visitor] content [/visitor] | Shows content within the shortcodes to only users that have not yet enrolled into the current course |
[student ] content [/student] | Shows content within the shortcodes to only users that are enrolled in the current course |
[course_content] | Displays the list of lessons, topics, and quizzes of the current course |
[course_content course_id="123"] | Displays the list of lessons, topics, and quizzes of the specified course |
[ld_profile ] | Displays the user’s enrolled courses, course progress, quiz scores, and achieved certificates |
[ld_course_list] | Shows the list of courses. You can use this shortcode on any page if you dont want to use the default /courses page. |
[ld_course_list num=”10″] | Limits the number of courses displayed |
[ld_course_list order=”ASC”] | Lists courses in ascending or descending order |
[ld_course_list orderby=”title”] | Sets order of courses See the full list of available orderby options |
[ld_course_list tag=”math”] | Shows courses with the specified tag |
[ld_course_list tag_id=”30″] | Shows courses with the specified tag ID |
[ld_course_list cat=”10″] | Shows courses with the specified category ID |
[ld_course_list category_name=”math”] | Shows courses with the specified category slug |
[ld_course_list mycourses=”true”] | Shows courses that the current user has access to |
[ld_lesson_list ] | Shows list of lessons. You can use this shortcode on any page. |
[ld_lesson_list num=”10″] | Limits the number of lessons displayed |
[ld_lesson_list order=”ASC”] | Lists lessons in ascending or descending order |
[ld_lesson_list orderby=”title”] | Sets order of lessons See the full list of available orderby options |
[ld_lesson_list tag=”math”] | Shows lessons with the specified tag |
[ld_lesson_list tag_id=”30″] | Shows lessons with the specified tag ID |
[ld_lesson_list cat=”10″] | Shows lessons with the specified category ID |
[ld_lesson_list category_name=”math”] | Shows lessons with the specified category slug |
[ld_quiz_list ] | Shows list of quizzes. You can use this shortcode on any page. |
[ld_quiz_list num=”10″] | Limits the number of quizzes displayed |
[ld_quiz_list order=”ASC”] | Lists quizzes in ascending or descending order |
[ld_quiz_list orderby=”title”] | Sets order of quizzes See the full list of available orderby options |
[ld_quiz_list tag=”math”] | Shows quizzes with the specified tag |
[ld_quiz_list tag_id=”30″] | Shows quizzes with the specified tag ID |
[ld_quiz_list cat=”10″] | Shows quizzes with the specified category ID |
[ld_quiz_list category_name=”math”] | Shows quizzes with the specified category slug |
[learndash_course_progress ] | Displays the current user's progress for the current course. You can use this shortcode on any course/lesson/quiz page. |
[ld_course_expire_status ] | Displays the current user's course access expiry date |
[ld_course_expire_status course_id=”111″] | Displays the specified course's access expiry date |
[ld_course_expire_status user_id=”222″] | Displays the specified user's course access expiry date |
[ld_course_expire_status label_before=”Your access to this course will expire on:”] | Displays the label before the access expires. Default label is “Course access will expire on:” |
[ld_course_expire_status label_after=”Your access to this course expired on:”] | Displays the label after access has expired. Default label is “Course access expired on:” |
[ld_course_expire_status format=”F j, Y g:i a”] | Sets the format of date/time of the expiry date. If not provided, the date/time format from your WordPress system will be used. |
[course_complete ] content [/course_complete] | Shows content within the shortcodes if the user has completed the current course |
Group Shortcodes
Shortcode / Block Name | Description |
---|---|
[uo_groups_redemption_form] Enrollment Key Redemption | Adds a single field redemption form for enrollment keys, to be used on pages or in widgets, with existing users. |
[uo_groups] Group Management | The Group Management page provides all the functionality for Group Leaders to manage their own groups. |
[uo_groups_course_report] Course Report | The Group Leader Report (which can also be accessed from the Group Management page) allows Group Leaders to view progress reports of their group members. |
[uo_groups_registration_form] Enrollment Key Registration | The Groups Registration page is a custom registration page you can use when inviting users to join a group and redeem an enrollment code. |
[uo_groups_quiz_report] Quiz Report | The Group Leader Quiz Report allows Group Leaders to view quiz reports of their group members. |
[uo_groups_buy_courses] Buy Courses | The Buy Courses page allows Group Leaders and new customers to purchase courses and create new groups directly. This page is only auto-generated if you activate the plugin after WooCommerce is installed and active. |
[uo_groups_restrict_content user_groups="123,456"][/uo_groups_restrict_content] | Allows for the creation of targeted messaging for logged in group members on pages and posts, based on group id. Does not block content for Admins. |
[uo_groupleader_restrict_content user_groups="123,456"][/uo_groupleader_restrict_content] | Allows for the creation of targeted messaging for logged in group leaders on pages and posts, based on group id. If the user_groups attribute is not present, content is visible to all group leaders. Does not block content for Admins. |
[uo_groups_link text="Link Text"] Group Management Link | Adds a link to the front end display for logged in Group Leaders and links them to the Group Management page. By default the link text will be "Group Management". You can set the link text using the text attribute. |
[uo_groups_button text="Button Text"] Group Management Button | Adds a button to the front end display for logged in Group Leaders and links them to the Group Management page. By default the button text will be "Group Management". You can set the button text using the text attribute. |
[uo_groups_essays] Essay Management | Allows Group Leaders to manage submitted essay questions on the front end. |
[uo_groups_assignments] Assignment Management | Allows Group Leaders to manage submitted assignments on the front end. |
[uo_groups_manage_progress] | Allow Group Leaders and admins to edit course progress on the front end. |
[uo_group_seats_total id="123"] | Output the total number of seats assigned to the group. Use ID to identify the associated group. |
[uo_group_seats_remaining id="123"] | Output the number of seats still available for a group. Use ID to identify the associated group. |
Certificate Shortcodes
Shortcode & Attribute | Description |
---|---|
[usermeta field=””] | Displays the value of the specified user meta field. Example: [usermeta field=”display_name”] |
[quizinfo show=""] | Displays information regarding quiz attempts. This shortcode can be used with the following attributes: score count pass rank timestamp points (only valid for the Advanced Quiz) total_points (only valid for the Advanced Quiz) percentage quiz_title course_title timespent (only valid for the Advanced Quiz) Example: [quizinfo show=”percentage”] shows the percentage score of the user in the quiz |
[quizinfo show=”timestamp” format=””] | Default: “F j, Y, g:i a” shows as March 10, 2001, 5:16 pm. [quizinfo show=”timestamp” format=”Y-m-d H:i:s”] will show as 2001-03-10 17:16:18 See the full list of available date formats |
[courseinfo show=""] | Displays course related information. This shortcode can be used with the following attributes: course_title completed_on cumulative_score cumulative_points cumulative_total_points cumulative_percentage cumulative_timespent aggregate_percentage aggregate_score aggregate_points aggregate_total_points aggregate_timespentv Note: - "cumulative" is average for all quizzes of the course. - "aggregate" is sum for all quizzes of the course. Example: [courseinfo show=”cumulative_score”] shows average points scored across all quizzes on the course. |
[courseinfo show=”completed_on” format=””] | Default: “F j, Y, g:i a” shows as March 10, 2001, 5:16 pm. [courseinfo show=”completed_on” format=”Y-m-d H:i:s”] will show as 2001-03-10 17:16:18 See the full list of available date formats |
Can we get a shortcode for the user’s first name?
Hi Yifat, LearnDash already includes a shortcode for that: [ usermeta field=”first_name” ]
It looks like the [usermeta field="first_name"] is broken on my site. Are there any known issues that may be causing this or should I submit a support ticket?
If you’re an LP customer, please do submit a support ticket from your account on our site. If you’re a general LearnDash user, please note that the shortcode you mentioned is part of LearnDash and not something we at Uncanny Owl can support, but more information is available at https://support.learndash.com/articles/usermeta/ and I’m sure LearnDash can provide assistance.
Hey Spencer, mine were broken too. My issue was I had pasted the quotes in and they were curly quotes. Delete and retype them and it might fix your problem.
Is there a shortcode to be used in user page to show progress deails of each course, like for example each lesson, topic and so on.. from when for example they can click and see again one topic …
The only shortcode we’re aware of that supports that type of functionality is the LearnDash Cousre Dashboard shortcode from our LearnDash Toolkit Pro.
You can learn ore about it here: https://www.uncannyowl.com/knowledge-base/learndash-course-dashboard/
Hi there
is there a shortcode to show only the title of the course?
Thanks
Unfortunately, as far as we’re aware there’s no existing shortcode that will output that info.
How to show/manage assignments on frontend instead?
There is currently no front-end management of assignments available in LearnDash or in any of our plugins. It is something we’ve considered adding to the Uncanny LearnDash Groups plugin, but the feature isn’t in our near-term roadmap.
in [[ld_profile]] appear 2 segments: info + registered course;
How can I do so that only the registered courses segment appears?
Hello Jose,
It is possible to hide elements of the LearnDash profile by using css. In order to remove the User Profile info so that only the Course List remains add this css to either your main style sheet or to the “Additional CSS” tab found in Appearance > Customize:
/** Hide user profile info **/
#learndash_profile .profile_info {
display: none !important;
}
/** Hide user profile heading text **/
.learndash_profile_heading span {
display: none !important;
}
/** Show learndash profile heading text **/
span.ld_profile_course, span.ld_profile_status, span.ld_profile_certificate {
display: inline-block;
}
Many thanks to the CSS code!
but the /** Show learndash profile heading text **/ part does not work, the heading for courses is still unavailable.
: )
The code should be:
/** Hide user profile info **/
#learndash_profile .profile_info {
display: none !important;
}
/** Hide user profile heading text **/
.learndash_profile_heading span {
display: none;
}
/** Show learndash profile heading text **/
span.ld_profile_course, span.ld_profile_status, span.ld_profile_certificate {
display: inline-block;
}
Thanks, Kinny!
Hi there,
Is there any shortcode to show a list/lists of enrolled student for every course?
There is no shortcode per se, but for Group Leaders there are options like ProPanel from LearnDash, which can list users in a course in the front end, and certainly in our Uncanny LearnDash Groups plugin there’s a shortcode that can list all users in a course using a report table.
I have this plugin purchased by my client and when I click to Edit profile it took me 404 error page. What is the shortcode for profile details edit page like the demo link below.
https://demo.learndash.com/your-profile/
Please note that we are not affiliated with LearnDash and that it’s their demo site. If you’re having issues with 404s, I would reach out to LearnDash directly if you’re having issues with their plugins. (You might try resaving permalinks from Settings > Permalinks though just in case there’s a permalink issue.)
Hi there, trying to use the following code as suggested from you but is not working:
[quizinfo show="cumulative_percentage" quiz_id="123"]
Any idea why?
Thanks
Regards
Hi Giorgio, that shortcode is a native LearnDash shortcode, so unfortunately we don’t have insight into why it may not be working for you. Please reach out to LearnDash support to see if they can help you out.
Hello is there a way to reorganize the Lesson Status list that is shown on the course page? Currently shows all of the lesson listed but for some reason the style is broken, meaning that the number of the lesson is shown in the different line and the circle that marks the status of the lesson is overlapping the lesson’s title.
Hope you guys can help me with that.
thank you
Sounds like a conflict with the theme. If you’re outputting lessons using one of the modules in the Pro Toolkit, log a support ticket with more information and we can take a look. If you’re using stock LearnDash lesson output, they should be able to point you in the right direction.
For the course grid, there is a link above that is supposed to tell us the order by options but it goes to some coding site…. what are the order by options. I want to order by the order that is set in WordPress for the classes
Sorry Mike, it’s not clear if you mean the LearnDash Course Grid add-on (which has recently been changed) or our module in Toolkit Pro. If it’s ours, maybe you can open a ticket with more details about what you’re seeing. More info about the site you’re directed to, the shortcode you’re using and how you’re configuring order would be helpful.