WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Jun 03 2011

Genesis Specific: Add Genesis SEO and Layout Options to My Custom Post Type

Understanding WordPress Custom Post Types
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, add_post_type_support();. In your functions.php, add the following:
[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]

Written by Travis Smith · Categorized: Custom Post Types, Genesis

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Reginald says

    October 22, 2011 at 11:06 pm

    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’);
    }

    Reply
  2. hsnyc says

    March 29, 2015 at 3:00 pm

    I have been looking for this info for hours now. Thank you so much for posting this Travis!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in