Changing post type and/or theme based on content

Hello!

I'm helping to create a site with on online learning component.

My customer uses Infusionsoft, so we needed to use the Memberium plugin to integrate with Infusionsoft. To build the courses, we're using Learndash because Memberium integrates with it.

We're using the Divi them for the site. However, it appears that the theme is somehow preventing the ability to change certain things in the Learndash course or lesson pages so that we can make them look pretty.

Here is what I received from Learndash:

Thanks for writing. We have had users report having trouble with Divi's page builder and LearnDash before. Unfortunately, there isn't much we can do about this particular issue because Divi is the developer and it's their code. That being said, there are some other ways which you might be able to alter the template used for your Lessons and Courses. By default, LearnDash use's your theme's blog single.php template. Using a plugin, you can choose another template to use:
https://support.learndash.com/frequently-asked-questions/#how-do-i-change-the-template-used-for-courses-and-lessons

You can even create your own templates if you wish. For more on styling LearnDash you can see this link:
https://support.learndash.com/articles/styling-learndash-elements/
For more on creating your own templates and child themes in WordPress, you can see this link:
https://codex.wordpress.org/Child_Themes

Divi probably has some documentation on creating a child theme with their theme as well.

I'm wondering if there might be another way to do this? I know that there are themes available that integrate specifically with Learndash and make everything look great. Is there a way to install a theme like that and only have it display when users access the course content?

  • Kasia Swiderska

    Hello Kevin,

    Is there a way to install a theme like that and only have it display when users access the course content?

    Writing solution that will switch theme depending on content could be more complicated than writing child theme. There are theme switcher plugins (like https://premium.wpmudev.org/project/advanced-theme-switcher/ ) but they are used to preview themes and you would need to switch them depending on url or post type.

    Did you consider moving your courses to separate WordPress installation? So they could work on subdomain of your domain - and then your main site would be working on Divi theme and courses separate on the learndash theme on own WordPress. What do you think?

    kind regards,
    Kasia

  • Kevin

    Hi Kasia,

    Yes, I was thinking about a separate WordPress installation as a possibility. Do you think this would be easier that creating a child theme and editing templates?

    If I understand correctly, when creating a child them I would simply be putting any WordPress template files in the child theme directory so that the site uses them.

    But I probably still wouldn't have as much flexibility with the overall look of the page doing it that way as opposed to either using the plugin shortcodes in new pages or putting Learndash in a separate install, correct?

    I'm not an expert on what I can do with child themes :slight_smile:

  • Rupok

    Hi Kevin, hope you had a wonderful day.

    Do you think this would be easier that creating a child theme and editing templates?

    It totally depends on your expertise and requirements, but in general, creating a separate site with new theme is much easier than creating a child theme and editing templates.

    when creating a child them I would simply be putting any WordPress template files in the child theme directory so that the site uses them

    Yes, but if that template file content doesn't match with your mother theme, then design will break. For example, in your mother theme, <head> tag is initialized in "header.php", so "single.php" template won't contain that. Now if you paste "single.php" file from another theme in child theme folder, and your child "single.php" file contains "<head> tag again, you understand the consequences. So you need to be careful while creating child themes.

    Please let us know if you have any further confusion. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.