The Elementor page builder recently passed the 3 million active install mark, making it arguably the most popular WordPress page builder out there. And for good reason.
It can be a powerful tool for designing beautiful landing pages, including those used in your online courses. Since LearnDash doesn’t provide much in the way of design for course, lesson & topic pages, Elementor is a great tool to use alongside LearnDash.
The Big Problem: Why can’t you select the course, lesson or topic post type when creating a “Single” Elementor template with the Theme Builder?
Thankfully, there’s a fairly easy solution. I’ll explain the two main steps below.
Step 1: Enable LearnDash Post Types in Elementor Settings
First, you need to make sure the LearnDash post types are enabled in your Elementor settings.
- Navigate to Elementor > Settings
- On the “General” tab, in the “Post Types” section, look for the LearnDash post types
- Make sure the boxes are checked for Courses, Lessons & Topics (Quizzes, Essays & Assignments are also available)
- Click Save Changes at the bottom
For most other plugins & custom post types, this will be all that is needed. However, LearnDash post types are set up a bit differently, and Elementor still doesn’t recognize them as being available to use with Theme Builder templates. So…
Step 2: Add a Custom Code Snippet
This code snippet is provided by LearnDash, and it makes a slight change to how LearnDash post types are registered. Essentially, it adds the feature that Elementor needs in order to use courses, lessons & topics as single templates in Elementor.
Where to put the code
My recommendation is to use the Code Snippets plugin. This plugin allows you to run custom code snippets as if they were placed in your child theme’s
functions.php file. But you don’t have to worry about potentially messing something up in that file, as it is crucial to your site’s well-being. One tiny error in that file and your entire site could go down.
- Install & activate “Code Snippets” from your WordPress plugins page
- Navigate to Snippets > Add New in the left sidebar
- Give your snippet a name. Something like “Elementor – Enable LearnDash Post Types.”
- Paste the code snippet into the Code area
- Click the Save Changes and Activate button
I think you need to be using LearnDash 3.0 or higher for this to work. I tried it with LearnDash 2.6.6 and it didn’t work for me.
Now return to the Elementor Theme Builder and add a new template. Select the “Single” template type, and then you should see courses, lessons & topics available in the post type dropdown.