Support » Plugin: Advanced Excerpt » LearnDash 3 – ‘Lesson’ CPT

  • Resolved Dan

    (@reggie_bond)


    Hi WPKube,

    I am using Learndash 3 and they have some CPTs. One is the “lessons” (‘sfwd-lessons’) and despite what I am doing, I can’t get an excerpt being displayed (integrated) in the back end. It does not show in the screen options nor in the post backend itself.

    No caching, no CDN, nothing – pure dev stage.

    Any hint would be very helpful!

    Thanks,
    Dan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPKube

    (@wpkube)

    Hi @reggie_bond

    The plugin doesn’t alter anything in the admin.

    When registering custom post types with register_post_typeone of the parameters in there is to set what the new post type support. One of those things is “excerpt” and I’m assuming that it wasn’t added to the list of supported functionality.

    You could add support to specific functionality using the function add_post_type_support

    Here’s an example of adding “excerpt” support for a custom post type:

    function my_prefix_init() {
        
        add_post_type_support( 'sfwd-lessons', 'excerpt' );
    
    } add_action('init', 'my_prefix_init');
    Dan

    (@reggie_bond)

    Hi there,

    Thank you very much for taking the time to help me out! Much appreciated!

    Plugin: I understand. I must have misinterpreted the function. But, I still will use it for the provided parameters.

    PHP Snippet: Great! I have implemented 2 snippets into my functions.pp. Both work as intended, excerpt fields in CPT backends are now available. For reference in case somebody is researching the topic:

    for LearnDash 3 ‘Lessons’:
    function excerpt_cpt_sfwd_lessons_init() {
    add_post_type_support( ‘sfwd-lessons’, ‘excerpt’ );
    } add_action(‘init’, ‘excerpt_cpt_sfwd_lessons_init’);action(‘init’, ‘my_prefix_init’);

    for LearnDash 3 ‘Courses’:
    function excerpt_cpt_sfwd_course_init() {
    add_post_type_support( ‘sfwd-courses’, ‘excerpt’ );
    } add_action(‘init’, ‘excerpt_cpt_sfwd_course_init’);

    Again, thank you!

    • This reply was modified 1 month, 2 weeks ago by Dan. Reason: formatting
    Plugin Author WPKube

    (@wpkube)

    You’re welcome @reggie_bond

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.