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]

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Print
  • Email

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

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

Need Help?

Please let us know how we can help you!

Get Help

Recommendations

Genesis WordPress Framework
Sucuri Security
Gravity Forms
GetSoliloquy
Get Envira
Scribe SEO
BackupBuddy
WordPress Video User Manuals

Recent Posts

  • Hiding an User in the WordPress Admin
  • Custom Rewrite Rules for Custom Post Types and Taxonomies
  • WordPress JavaScript Manager Native Functions
  • Causes of WordPress Site Performance Slowdown
  • Need for Speed

Latest Tweets

  • New post on my blog: Complete text of the Bill Gates “Trustworthy Computing” Memo https://t.co/dbhC7d85ht May 9, 2019 1:33 pm
  • New post on my blog: The Argument About What Is Stp in Chemistry https://t.co/YBPMm1bzks April 18, 2019 3:21 pm
  • New post on my blog: Infographic: The Entire JavaScript Language in One Single Image https://t.co/F1rTxCIWas March 22, 2019 5:45 pm
  • New post on my blog: Jim Casey’s “A Talk with Joe” https://t.co/KfWzsEd6qz March 22, 2019 5:45 pm
  • New post on my blog: Email in Real Life https://t.co/gM0W4vffZQ March 22, 2019 5:45 pm
  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2019 WP Smith on Genesis on Genesis Framework WordPress Log in

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.