WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Apr 10 2012

Add Genesis SEO, Layouts, & Sidebars to Custom Post Types

Now, if you want to add Genesis functionality, that is, Genesis SEO, Layouts, & Sidebars, to existing custom post types (that you may have registered via another plugin), then you need the following.
[php]
add_action( 'init', 'wps_add_post_type_support' );
/**
* Add Genesis custom support for registered post types
* Add Genesis SEO/Layout support to CPTs (if not registered with them)
*
* @uses add_post_type_support() Registers support of certain features for a given post_type
* @link http://codex.wordpress.org/Function_Reference/add_post_type_support
*
*/
function wps_add_post_type_support() {
// Uncomment below as appropriate
//add_post_type_support( 'post_type', 'genesis-seo' );
//add_post_type_support( 'post_type', 'genesis-layouts' );
//add_post_type_support( 'post_type', 'genesis-simple-sidebars' );
}
[/php]

To add the above to multiple post types:
[php]
add_action( 'init', 'wps_add_post_type_support' );
/**
* Add Genesis custom support for registered post types
* Add Genesis SEO/Layout support to CPTs (if not registered with them)
*
* @uses add_post_type_support() Registers support of certain features for a given post_type
* @link http://codex.wordpress.org/Function_Reference/add_post_type_support
*
*/
function wps_add_post_type_support() {
$pts = array( 'post_type1', 'post_type2' );
foreach( $pts as $pt ) {
// Uncomment below as appropriate
//add_post_type_support( $pt, 'genesis-seo' );
//add_post_type_support( $pt, 'genesis-layouts' );
//add_post_type_support( $pt, 'genesis-simple-sidebars' );
}
}
[/php]

Written by Travis Smith · Categorized: Custom Post Types

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. Joe Banks says

    April 26, 2012 at 11:19 am

    Travis,
    Thanks for bringing this to our collective attention. Extremely helpful, especially as we have been integrating plug-ins that use custom posts in our Genesis sites.

    Reply
  2. Scott Buehler says

    February 22, 2013 at 1:11 pm

    Travis, thanks for the post. Even WordPress’ site says there’s support for an array in add_post_type_support yet they provide no example. Since I use Genesis anyway, I’m going to use your multiple post types code. Appreciated!

    Reply
  3. marlon b says

    September 28, 2013 at 9:19 pm

    Travis – thanks this is very helpful. Good Stuff for plugins – Very useful.

    Much appreciated!

    Marion :)>

    Reply
  4. Angel Snape says

    September 29, 2013 at 12:45 am

    Yo Travis thanks for the informative post. Helped me get a few things I didn’t quite get before.

    Take care and best wishes :)>>

    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