Salient theme header custom post type FIX. Salient is well known WP theme and preferred by many. It gives the editors a beautiful way how to manage their page headers.

But those configs are not available for custom post types. Here is a few step guide how to enable the page header options for custom post types.

Salient theme header custom post type fix

In Salient parent theme there are two files that enable the header options. one for pages and one for posts. The files are:

salient/nectar/meta/page-meta.php 
salient/nectar/meta/post-meta.php

Pages have a bit more options but weather you want the post type header options or page type header options the process is the same. Here is what you need to do:

 

1. Duplicate one or both files in your child theme and place it in the same folder structure

YOUR_CHILD_THEME/nectar/meta/page-meta.php 
YOUR_CHILD_THEME/nectar/meta/post-meta.php

2. In your child themes functions.php place the following line or lines

include("nectar/meta/page-meta.php");
include("nectar/meta/post-meta.php");

 

3. Modify the content of the files: change the name of the function line 2 and 3

add_action('add_meta_boxes', 'YOURTHEME_metabox_page');
function YOURTHEME_metabox_page()

 

4. For every occurrence in the duplicated file change the $meta_box array’s post_type keys value with an array of your own custom post types

#-----------------------------------------------------------------#
# Fullscreen rows
#-----------------------------------------------------------------#
  $meta_box = array(
  'id' => 'nectar-metabox-fullscreen-rows',
  'title' => __('Page Full Screen Rows', NECTAR_THEME_NAME),
  'description' => __('Here you can configure your page fullscreen rows', NECTAR_THEME_NAME),
  // 'post_type' => 'pods_cpt_event',   < -- REMOVE THIS LINE and
  // ADD the following line with an array of your custom post types
  'post_type' => array('POST_TYPE1','POST_TYPE2','POST_TYPE3'), // <- like so

.....
next occurrence >>
.....

#-----------------------------------------------------------------#
# Header Settings
#-----------------------------------------------------------------#
  $meta_box = array(
  'id' => 'nectar-metabox-page-header',
  'title' => __('Page Header Settings', NECTAR_THEME_NAME),
  'description' => __('Here you can configure how your page header will appear. <br/> For a full width background image behind your header text, simply upload the image below. To have a standard header just fill out the fields below and don't upload an image.', NECTAR_THEME_NAME),
  // 'post_type' => 'pods_cpt_event',   < -- REMOVE THIS LINE and
  // ADD the following line with an array of your custom post types
  'post_type' => array('POST_TYPE1','POST_TYPE2','POST_TYPE3'), // <- like so


.....
next occurrence >>
.....

  #-----------------------------------------------------------------#
  # Portfolio Display Settings
  #-----------------------------------------------------------------#

  $meta_box = array(
  'id' => 'nectar-metabox-portfolio-display',
  'title' => __('Portfolio Display Settings', NECTAR_THEME_NAME),
  'description' => __('Here you can configure which categories will display in your portfolio.', NECTAR_THEME_NAME),
  // 'post_type' => 'pods_cpt_event',   < -- REMOVE THIS LINE and
  // ADD the following line with an array of your custom post types
  'post_type' => array('POST_TYPE1','POST_TYPE2','POST_TYPE3'), // <- like so

That’s it, the header options should show up when editing your custom post type

If you are having difficulties with the options showing up  copy of page-meta.php from https://gist.github.com/lehelmatyus/640fd63ba94e605daf03487202e2c7d9.

Just be shure to replace the following: YOURTHEME_metabox_page and POST_TYPE1 …

add_action('add_meta_boxes', 'YOURTHEME_metabox_page');
function YOURTHEME_metabox_page(){

...

'post_type' => array('POST_TYPE1','POST_TYPE2','POST_TYPE3'),

Please ♥ Like the page if you found this useful! Cheers!