This topic has 8 replies, 3 voices, and was last updated 9 years by Abe.

  • Author
  • #125606
     maarten
    Participant

    Hi,

    I am trying to remove post meta from all our LearnDash course pages. I’d like to accomplish this with the functions.php and found the code below for Genesis frameworks. I am not sure how Kleo defines the post meta. Can you help me out so I can replace the Genesis-specific references in the actions?

    Thanks!

     

    <?php
    // Remove Post Info, Post Meta from CPT
    function wpb_remove_post_info() {
    if (sfwd-courses || sfwd-lessons || sfwd-quiz || sfwd-certificates == get_post_type()) {
    remove_action( genesis_entry_header, genesis_post_info, 12 );
    remove_action( genesis_entry_footer, genesis_post_meta );
    }
    }
    add_action ( genesis_before_entry, wpb_remove_post_info );

    From:

    https://wpbeaches.com/remove-post-info-and-meta-in-learn-dash-custom-post-types/

    #125685
     Radu
    Moderator
    Not marked as solution
    #125697
     maarten
    Participant
    Not marked as solution
    #125840
     Abe
    Keymaster
    Hi there, until next version please replace this file where I added an extra filter. The file from the zip should be replace in the theme under "/lib" folder. After doing that you can add this snippet to your child them functions.php
    add_filter('kleo_postmeta_enabled','kleo_my_meta_changes');
    function kleo_my_meta_changes( $meta_status ) {
        if ( 'sfwd-certificates' == get_post_type()) {
            return 0; // zero disables it, 1 enables it
        }
    
        return $meta_status;
    
    }
    
    #125847
     maarten
    Participant
    Not marked as solution
    #125848
     maarten
    Participant
    Not marked as solution
    #125888
     Abe
    Keymaster
    Not marked as solution
    #125895
     maarten
    Participant
    Not marked as solution
    #125896
     Abe
    Keymaster
    Not marked as solution
Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?