Change the WordPress Post Type name to Something Else

wordpress-rename-post-type

You can change the default Post type name in WordPress from Posts to something else like News using the get_post_type_object,  normal behaviour of the Posts occur just the label name in the WordPress dashboard has been changed.   add_action( ‘init’, ‘cp_change_post_object’ ); // Change dashboard Posts to News function cp_change_post_object() { $get_post_type = get_post_type_object(‘post’); $labels =…

Read More

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…

Read More

Add a Custom Post Type Template in WordPress 4.7

custom-post-type template

WordPress 4.7 brings a new feature in the ability to add a Custom Post Type template in a similar way a Page Template is added. A page template can be added by creating a specific file page-{id}.php or page-{slug}.php file, the problem with this approach is that it is not reusable for other pages, so a…

Read More

Set a conditional argument for multiple Custom Post Types in WordPress

cpts-conditionals

You can set a conditional argument for multiple custom post types in WordPress using in_array The format is like so… if( in_array( get_post_type(), array( ‘treatment’, ‘package’ )) ) {//add in cpts here // do stuff } else { //what all the other post types get // do other  stuff } } It searches the array of cpts…

Read More