Customizing LearnDash 3.0 templates

If you’ve ever done any customization of the LearnDash template files, you’ll find that the process has changed with the release of LearnDash 3.0.

For example, in LearnDash 2.X, to customize a lesson page you would copy lesson.php from the plugin directory to your child theme, edit it, and your changes will show up on the site. But take a look at the legacy lesson.php template as compared to the 3.0 version:

The legacy lesson.php file on the left, and the 3.0 version on the right.

So it’s hard to see in the small screenshots, but the new 3.0 lesson.php file has almost no HTML code in it. There’s really not much to customize if you’re wanting to modify the layout. You’ll need to locate the file that has the appropriate code you want to modify, and depending on what you are changing, you may have to edit more than one php file.

The trick is finding out which file has the code to change. What I did was download the entire 3.0 theme directory from the plugin: /wp-content/plugins/sfwd-lms/themes/ld30.

Then, I located the section of the code I wanted to modify by viewing the source code of a rendered page.

In my case, I wanted to add some custom text below the breadcrumb on my topic pages. The breadcrumb uses the CSS class “ld-topic-status”, so I searched that entire ld30 directory for that class (just use FileSeek or something similar). That led me to the file /wp-content/plugins/sfwd-lms/themes/ld30/templates/modules/infobar.php.

 To make it even more confusing, topic and lesson templates don’t use the same naming structure – to do the same thing to a lesson, I have to edit /wp-content/plugins/sfwd-lms/themes/ld30/templates/modules/tabs.php.

Once you’ve edited the file to your liking, you’ll upload it to your child theme, with a slightly different directory structure.

 In your child theme, make a folder structure like this: /wp-content/themes/xxx-child/learndash/ld30

Then, you’ll create subfolders without the templates folder. In other words, if you’re overriding the file:
then the file in the child theme will be:

Just upload the new file to your child theme, in the correct folder.

One more gotcha – you can’t tell what templates have been overridden by checking out the support tab of the LearnDash Settings page:

If you override the actual lesson.php file, it will turn red on this page. But you’ll find that the majority of the files you need to work with aren’t actually listed here.

6 thoughts on “Customizing LearnDash 3.0 templates”

  1. Thank you for this. I’d worked with custom templates in < 3.0, but this was helpful for seeing the structure change. The code looks a heck of a lot cleaner but is definitely more abstracted.


  2. THANK YOU!!! I don’t know why LD doesn’t tell you the folder structure to use when you want to edit any of the core files.

  3. There is so much logic and display code in the new learndash templates that you will have to monitor these files for every single update. It’s disappointing that they did not take the time to split the logic and display parts of their templates to keep things clean. There is also no versioning so you will have absolutely no way to track if and when they make changes to those files. You will have to do file diff comparisons to figure out what they changed. What an absolute disgrace. This alone has me looking for a new LMS.

  4. You saved my day! I was looking everywhere for this and had been doing the theme/templates/… method for so long trying to overwrite courses.php .

    Again , thank you!

Leave a Comment

Your email address will not be published. Required fields are marked *