So if you are running on the Genesis Framework, and you've created your new custom post type. So where are the SEO options!? Well, more than likely, you didn't add support for the Genesis SEO options to your custom post types. This feature alone makes Genesis so powerful and such an awesome Theme Framework. To add the Genesis SEO options only takes one additional support code, not even one line.
Wherever you registered your custom post type, add 'genesis-seo', 'genesis-layouts' to the support array. And there it is! Genesis SEO options are now available for your custom post type! (see sample example below).
If you do not have the registration code or the plugin does not allow you to add custom support features, no problem! Just use,
[php]
add_post_type_support( 'wps_cars', 'genesis-seo' );
add_post_type_support( 'wps_cars', 'genesis-layouts' );
[/php]
It would need to occur in the 'init' hook. So, in your functions.php, it will appear as:
[php]add_action('init', 'my_custom_init');
function my_custom_init() {
add_post_type_support( 'wps_cars', 'genesis-seo' );
add_post_type_support( 'wps_cars', 'genesis-layouts' );
}
[/php]
Sample Custom Post Type Registration with Genesis SEO Support
[php highlight="26"]add_action('init', 'wps_cpt_init');
function wps_cpt_init() {
$labels= array(
'name' => _x('Cars', 'post type general name'),
'singular_name' => _x('Car', 'post type singular name'),
'add_new' => _x('Add New', 'car'),
'add_new_item' => __('Add New Car'),
'edit_item' => __('Edit Car'),
'new_item' => __('New Car'),
'view_item' => __('View Car'),
'search_items' => __('Search Car'),
'not_found' => __('No cars found'),
'not_found_in_trash' => __('No cars found in Trash'),
'parent_item_colon' => '',
'menu_name' => 'Cars'
);
$args = array(
'labels' => $labels,
'public' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','author','thumbnail','genesis-seo')
);
register_post_type( 'wps_cars' , $args );
}[/php]
Reginald says
Hi travis,
I’m using events calendar pro, when I go to add a event, there is no support for genesis-layout. How do I add support for the genesis-layout option.
I try your code in your post but it did not work. I must be doing something wrong. Can you give me a helping hand to resolve this issue?
Thank in advance.
Reggie
Update: the code you have on your site did work, I use the wrong word ‘event’ instead of ‘tribe_events’…
// Add Support for Genesis Layout Setting
add_action(‘init’, ‘my_custom_init’);
function my_custom_init(){
add_post_type_support(‘tribe_events’, ‘genesis-layouts’);
}
hsnyc says
I have been looking for this info for hours now. Thank you so much for posting this Travis!