Affiliate Disclosure: We may be compensated if you use our links to make a purchase. We are extremely selective in who we partner with & only recommend products we believe in. Our affiliate relationships do not influence our recommendations.
The Elementor page builder has now surpassed 5 million active installs, 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.
For lessons/topics, this only works when you are NOT using Focus Mode. Focus Mode completely takes over the layout of lesson/topic pages, and Elementor theme builder templates will not be applied.
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.
Get the code snippet →
Updated April 11, 2020
NOTE: There are two pieces of code, depending on which version of Elementor Pro you are running. Just choose the one that applies to you (don’t use both).
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.
Per the comments below, it also looks like you need to be using PHP 7.3 or higher.
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.
Now that you have the option, why don’t you learn how to create a custom course template with Elementor →