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:
/wp-content/plugins/sfwd-lms/themes/ld30/templates/modules/infobar.php
then the file in the child theme will be:
/wp-content/themes/xxx-child/learndash/ld30/modules/infobar.php
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:
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.
Cheers,
Carrie
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.
Thanks a lot! LearnDash doc is poor for developers and this saved my life!
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.