Change featured image box title for custom post types
Sometimes we need to change the title of metabox which is for our featured image section for ant particular post types. Generally we create post types to manage different types of posts in wordpress. So, in this situation we want to show everything relevant to these post types.
In this reference we need to change the title of metabox for featured image that is “Featured Image” by default.
Just copy and paste below mentioned code in your functions.php file of your current theme :
<?php add_action( 'admin_head', 'change_meta_box_title' ); function change_meta_box_title() { remove_meta_box( 'postimagediv', 'post_type', 'side' ); //replace post_type from your post type name add_meta_box('postimagediv', __('Put Your Title Here'), 'post_thumbnail_meta_box', 'post_type', 'side', 'high'); } ?>
In this case we are just removing previous meta_box and adding new meta_box to change the title. We are using two important functions of wordpress they are remove_meta_box() and add_meta_box().
So, just paste the code and it will give you your desired result.
Leave a Reply