As you learn the ropes of WordPress and LearnDash, you’ve likely seen the term ‘shortcode’ being used here and there.
These short bits of code can be placed wherever you need a dedicated function, and it’s designed to be a lot easier than traditionally longer pieces of text.
What are LearnDash shortcodes? A LearnDash shortcode is a piece of shortcode that lets you use certain features and functions on your site.
The shorter coding is easier for people to utilize and it means you don’t need to know how to write code yourself, as there are ones made specifically for the LearnDash plugin.
If you’ve been playing around with LearnDash and feel like you need help on the coding side of things, shortcodes will be just what you’re looking for.
This quick guide will cover the basics of these codes and what the most commonly used ones are for learning management systems.
What are Shortcodes?
Shortcodes are as simple as their name implies: a truncated or shortened piece of code.
Used by WordPress, shortcodes give instructions to use certain features or functions in specific places, and they’re helpful as you’re building and editing a website, especially one on LearnDash.
A shortcode is usually written in a way that’s obvious for the user to see what it does, and the clues are given in the words that it uses, with brackets hugging the code on either side.
These codes might also include a parameter or option so you can customize the information you want to display, and they have rules for how they should be used, but it’s unique for each one.
Once you’ve written the shortcode into the editor or page builder, WordPress will read it and then know to execute a longer section of code.
The entire goal of shortcodes is to save time for you as the website developer, which it does, so learning how to make them work for your LearnDash site is one of the most efficient things you can do.
Does LearnDash Use Shortcodes?
Shortcodes were originally created to let you put dynamic content into your WordPress editor, but with LearnDash, they can do a little more.
A shortcode can be used to insert content into page builders as well, making it a lot faster and easier to develop course content, even when there’s a lot of information.
The main LearnDash shortcodes start with ‘ld’ indicating that they’re used for this platform, but there are others without the ‘ld’ prefix.
If you’re using the Uncanny Owl plugin with LearnDash, as many people do, there are another lit of shortcodes that make it a lot easier to work with.
When you get the default installation of LearnDash, these shortcodes will be included with it for use with the online course platform.
Once you have this reliable list of shortcodes that you can use for your site, it’s easy enough to copy and paste them into your WordPress editor without having to write out the whole thing yourself, insert them using the dedicated button, or you can learn them from memory and type them in.
Common LearnDash Shortcodes
The list of LearnDash shortcodes is a long one, so we’re not going to display all of them here. Instead, we’ve created a list with some of the more commonly used shortcodes so you can see what they’re capable of when building and editing your learning website.
For each code, there are instructions for use and sometimes parameters, so it’s worth investigating what each of them can do.
- [ld_course_info]: This code will display a full list of registered courses that the student is enrolled in, their progress, and any quizzes they’ve completed. There are a few options for customizing this one.
- [ld_profile]: Shows the user a basic profile including their username, avatar, full name, and information about their studies including quiz results, course points, and which courses they’re enrolled into.
- [ld_course_list]: This shortcode allows for a full list of courses to be displayed, and there are lots of parameters for customizing the output and how the results are filtered. For even more options, enable the Course Grid add-on and it can show all of this information in a grid layout if the user prefers it.
- [learndash_login]: Using this shortcode will display a login button on the page that can be used to log into their learning account through the LearnDash login modal. If logged in, the button will change to a logout one to give them this option.
- [student]: This shortcode displays all of the information on the page as if the user is logged in as a student, compared to another shortcode that shows a non-enrolled student’s view. You can also display information for a specific user if you finish with a closing [/student] tag.
- [uo_breadcrumbs]: To be used with the Uncanny Owl Toolkit plugin, this shows users a breadcrumb trail of the previous pages they’ve been in. The trail will read like Course > Lesson > Topic so it’s displayed as a hierarchy.
- [uo_learndash_certificates]: This is another shortcode used only with the Uncanny Own Toolkit and it lets users see a full list of certificates they’ve obtained during their studies.
- [uo_groups_buy_courses]: Available with Uncanny Owl Pro version and with WooCommerce activated and installed, this shortcode allows new customers and group leaders to purchase courses through your page, and then create new groups with a one-click button.
➡️ LearnPress Vs LearnDash
➡️ LearnDash Vs LifterLMS
A Shorter Way to Code
When you start a LearnDash site, it can be overwhelming to learn the ropes, especially when it comes to coding.
Shortcodes make it easier to perform the basic functions and features, so you can spend more time building your digital classroom and less time learning to code.