Community Forums › Forums › Archived Forums › Design Tips and Tricks › Custom Post Type add filed under: category names
Tagged: CPT, Custom Post Type, filed under, meta data
- This topic has 7 replies, 4 voices, and was last updated 11 years, 6 months ago by
deejuk.
-
AuthorPosts
-
July 23, 2014 at 5:38 am #115486
deejuk
MemberHi all
I have created a custom post type and have the data displaying fine. However I want to include the custom taxonomy details in the bit that says Filed Under:
This bit is the bit that normally shows the Filed Under: Category 1, Category 2 etc.
Does anyone know how to do this - any help would be great
July 23, 2014 at 6:44 am #115492Genesis Developer
Memberuse this shortcode
[post_terms taxonomy="YOUR TAXONOMY HERE"]
July 23, 2014 at 8:05 am #115507deejuk
MemberHi thanks for that ... where do I past the shortcode in functions.php or my a template file?
July 23, 2014 at 8:30 am #115512DTHkelly
MemberJuly 23, 2014 at 10:50 am #115533Brad Dalton
ParticipantAdd the shortcode to this code http://my.studiopress.com/snippets/entry-footer/#customize
July 24, 2014 at 3:56 am #115668deejuk
MemberThank you for the info. So added the following and it worked great for custom post types. It shows the CPT taxonomy under filed under, however the Category Taxonomy for regular posts is missing.
//* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { $post_meta = '[post_terms taxonomy="mytaxonomy"], [post_tags]'; return $post_meta; }
July 24, 2014 at 12:02 pm #115722Brad Dalton
ParticipantJuly 24, 2014 at 12:47 pm #115735deejuk
MemberThat kind of works better thank you Brad. I have the following code.
//* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { $post_meta = '[post_terms taxonomy="mytaxonomy"] [post_categories] [post_tags]'; return $post_meta; }This works fine for normal posts, but for custom post types I get left with an additional Filed Under: where the normal category should be. As it's not linked to normal categories it hasn't got one so obviously can't show it.
This is what I see when I view the custom post type archive
Filed Under: My custom taxonomy
Filed Under:
Tags: my post tagsThis is what I see when I view the normal post archive
Filed Under: A regular category
Tags: My post tags.Any help on this would be great .. even though it takes me a while to work out the pointers but thank you very much
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.