Reputation:
I want to remove the custom post type title field from specific custom post type in WordPress
My Custom post type is: post_type=dosage-details
So I remove this post type title field.
Upvotes: 1
Views: 1728
Reputation: 501
You could add the following code to your functions.php:
function remove_post_type_title() {
remove_post_type_support( 'dosage-details', 'title' );
}
add_action( 'init', 'remove_post_type_title' );
Upvotes: 2
Reputation: 1227
You can check the post type inside the loop by using the get_post_type() So you can have something like:
//if the post type is not 'dosage-details'
if ( 'dosage-details' != get_post_type() ) {
the_title();
}
Upvotes: 0