Remove Post Info and Meta in Learn Dash Custom Post Types

Learn Dash for WordPRess has five custom post types; courses, lessons, quiz, topic and certificates – the custom post type registration names are sfwd-courses, sfwd-lessons, sfwd-quiz, sfwd-topic and sfwd-certificates respectively.

To remove the default post info and post meta data from these custom post types in a Genesis theme use the following snippet in your functions.php file…

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

2 Comments

  1. Andrew Wilder on March 1, 2017 at 4:44 pm

    Very helpful – thank you!

    LearnDash also has a sfwd-topic post type – might want to include that in the code as well.

    • Neil Gowran on March 1, 2017 at 10:31 pm

      Thanks for pointing that out Andrew

Leave a Comment





%d bloggers like this: