Add Salient Metaboxes to a Custom Post Type
The page and post metaboxes Salient adds below the editor only appear on its own post types. A filter in your child theme adds them to a custom post type registered by a plugin or by the child theme itself.
- Step 1: Open your child theme functions.php (salient-child/functions.php)
- Step 2: Copy the snippet below into the bottom and replace “your_custom_post_type” with the name of your post type.
Page Meta Boxes
function salient_child_page_header_post_types($post_types) {
$new_post_types = array(
'your_custom_post_type'
);
$post_types = array_merge($new_post_types, $post_types);
return $post_types;
}
add_filter('nectar_metabox_post_types_page_header', 'salient_child_page_header_post_types');
Blog Post Meta Boxes
function salient_child_post_header_post_types($post_types) {
$new_post_types = array(
'your_custom_post_type'
);
$post_types = array_merge($new_post_types, $post_types);
return $post_types;
}
add_filter('nectar_metabox_post_types_post_header', 'salient_child_post_header_post_types');
-
If you want any of the other metaboxes on your custom post type, filters are available for those as well:
nectar_metabox_post_types_navigation_transparency nectar_metabox_post_types_fullscreen_rows