Community Forums › Forums › Archived Forums › Design Tips and Tricks › Custom Post Types – Registering Genesis Functionality
Tagged: custom post types, custom taxonomies, minimum, registering
- This topic has 10 replies, 2 voices, and was last updated 11 years, 6 months ago by eluviis.
-
AuthorPosts
-
March 7, 2013 at 12:48 pm #24819eluviisMember
It has been a long journey redesigning my site. Honestly, a new design is much easier to deal with than redesigning a 2-year old site.
I have a few bugs to work out, but for the most part, I'm launching this Sunday night.
I have one more thing to sort out. I have created one Custom Post Type using the plugin Easy Custom Post Type by Pippin's Plugins. Someone on here recommended it.
The custom post type with it's own taxonomy works well out of the box. But there are two things I need to fix on it.
1. Make the new Custom Post Type feed to the main RSS feed - That seems pretty easy using a tutorial Pippin himself recommended. No worries here.
2. This is the one I need help with. I need to make Genesis features work on the new Taxonomy…
This is what I can see is missing from the interface:
a. Theme SEO Settings
b. Layout settings with custom body classesThat's pretty much it really. Any idea how I get these Genesis features to register in my new custom post type?
The development site is rightisbackside.com - by Sunday it will be moved to it's permanent location at rallyways.com.
March 7, 2013 at 12:58 pm #24824Bill MurrayMemberTo you array of what your CPT supports, you add:
'genesis-seo'
'genesis-layouts'
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
March 7, 2013 at 1:41 pm #24833eluviisMember^^^ Oh dang, that was simple! THANK YOU!
There is a little field called "Advanced Supports" in the CPT settings. I added those separated by commas, and voila!
Is there a simple method like that to add RSS? Or am I going to have to work some magic in the functions.php file?
Also, I just noticed there is one small thing that is not working yet. I installed a plugin called, "Genesis Minimum Images Extended" recommended by @Kraft. This plugin basically places a large banner image were the Featured image goes in Minimum Theme, while you use a small square image for your post thumbnail featured image. Well, that one doesn't register in my CPT. Any clues?
Again, MANY THANKS.
March 7, 2013 at 1:51 pm #24835Bill MurrayMemberHere's how to add multiple CPT's to your feed:
function wpp_change_feed_request($qv) { if (isset($qv['feed']) && !isset($qv['post_type'])) $qv['post_type'] = array('post', 'cpt1', 'cpt2', 'cpt3'); return $qv; } add_filter('request', 'wpp_change_feed_request');
Just change cpt1 - cpt3 to the post types you want to add to your feed.
For your 2nd issue, I haven't used that plugin much. You'd have to look at the code for clues.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
March 7, 2013 at 2:00 pm #24837eluviisMemberOh nice, that's a much better snippet than the one in the tutorial recommended by the CPT plugin developer which dumps all CPT's and even pages into the RSS feed. This one's way more selective.
THANK YOU! I'll look into the plugin and see what I can find.
March 8, 2013 at 12:51 am #24946eluviisMemberI found one more bug. Under posts, there is a section at the end of every post that reads, "Filed Under:" and that is usually followed by a category name. Well, that only works for the standard WP category taxonomy.
My new custom post types will not show their taxonomy types display there. It's just blank. Like "File Under:" and displays nothing. Obviously, the custom taxonomies for my custom post types are not registering with Genesis. Any ideas how to fix that? Thanks.
March 8, 2013 at 1:02 am #24949eluviisMemberAs a followup to the post above... I looked in functions.php and I found the code snippet below for the "filed under" function. I just don't know how I would modify it to work with my custom post types and custom taxonomies. It's probably pretty simple, but I don't quite write PHP. I can see "post_categories before=", so I suspect I have to add something along those lines like "cpt_taxonomy name before=" or something like that, just not sure how. Anyone?
/** Customize the post meta function */ add_filter( 'genesis_post_meta', 'post_meta_filter' ); function post_meta_filter( $post_meta ) { if ( !is_page() ) { $post_meta = '[post_categories before="' . __( 'Filed Under: ', 'minimum' ) . '"] // [post_tags before="' . __( 'Tagged: ', 'minimum' ) . '"]'; return $post_meta; }}
March 8, 2013 at 1:38 am #24952eluviisMemberOne more thing, @Bill Murray - Is there a list of Genesis supports? I'm wondering where you got those terms you shared with me. I suppose there's a list of these somewhere.
March 8, 2013 at 12:45 pm #25028Bill MurrayMember1) Are you talking about custom taxonomies? If so, check get_the_term_list() in the WP codex. You'd include that in your template where you want the terms for the taxonomy to display.
2) I think I gave you the complete list. See the genesis_post_type_support() function around line 62 in genesis/lib/init.php.
That's where the array is created for what Genesis features a post or page supports. You are merely giving your CPT those values. If a new supports capability is added, I am sure it will show up there.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
March 8, 2013 at 2:42 pm #25045eluviisMember"1) Are you talking about custom taxonomies? If so, check get_the_term_list() in the WP codex. You’d include that in your template where you want the terms for the taxonomy to display."
Yes, exactly... Custom taxonomies. The Genesis/Minimum function that displays "Filed Under:" at the end of posts only lists stock WP categories, it won't work with my custom taxonomies. I'm looking at the articles and forum posts in the WP codex related to "get_the_term_list()", but I can't make sense of it.
2. I looked on genesis/lib/init.php - I see what you mean. Then I looked on functions.php for Minimum and looked closely at how the portfolio CPT is registered in there. All the supports added are stock WP supports, plus genesis-seo (that CPT doesn't use layouts). Makes total sense. Thanks for that.
I think once I figure out how to make the custom taxonomies list under "Filed Under:" this thing will be complete. Thanks for all your help. I'll look around some more and see if I can crack that. I have a feeling the function is solely under the Genesis framework and not on the Minimum Child Theme. So if I do find a way to make it work, I have to copy that to functions.php under the child theme.
March 8, 2013 at 2:55 pm #25046eluviisMemberWell here... I found this under Minimum functions.php...
/** Customize the post meta function */
add_filter( 'genesis_post_meta', 'post_meta_filter' );
function post_meta_filter( $post_meta ) {
if ( !is_page() ) {
$post_meta = '[post_categories before="' . __( 'Filed Under: ', 'minimum' ) . '"] // [post_tags before="' . __( 'Tagged: ', 'minimum' ) . '"]';
return $post_meta;
}}Now, my question would be... What do I change to include my custom taxonomies?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.