Site logo

Archived topic

Can't create sections inside of LearnDash LMS

7 replies · Started by Sebastian on October 14, 2019

Viewing posts 1–8 of 8

Hello,
Is it currently possible to use Sections inside of LearnDash LMS, and if so how?
This feature works fine on pages and post, but the option to use sections does not display anywhere inside of LearnDash.
Thanks!

Thank you Leo.
What is a CPT?
Also - and forgive my ignorance as I'm not a developer - what value am I supposed to use in "yourposttype"?
Thanks!

CPT is custom post type.

I'm not sure if LearnDash is using CPT or not - you'd need to check with their support.

If it is, then you can just replace yourposttype with the name of the CPT name.

Let me know :)

Got it

I just asked my good friend Google and found https://www.learndash.com/support/docs/developers/hooks-and-filters/

For future reference should anybody be looking for the answer, here it is:

1. Create a child theme or use the blank one provided at https://docs.generatepress.com/article/using-child-theme/

2. Update functions.php of that child theme with

add_filter( 'generate_sections_post_types','generate_add_section_post_types' );
function generate_add_section_post_types() {
return array( 'page','post','sfwd-courses','sfwd-lessons','sfwd-topic','sfwd-quiz' );
}

Glad you've figured out!

Thanks for sharing the code :)

Thank you Leo.
One more question, and it may seem strange at this point.
What's the benefit of using Sections?
Until now I had an aversion to Gutenberg and had disabled it.
My motivation for making Sections work with LearnDash was to be able to create columns, but Sections - as I just found out - doesn't do that.
This led me to explore Gutenberg and start to appreciate what it has to offer.
Seeing all it can do, I now wonder what the purpose of Sections is. Is it intended for people who don't like Gutenberg?

Sections came out a long time before Gutenberg was released.

Before Gutenberg editor there was only text/visual editor in WordPress so section was very useful back then.

We are working on a new plugin that will basically be a combination of Gutenberg + Sections and offer a lot of users features like columns etc.

Stay tuned :)

This archived topic is closed to new replies.