Home › Forums › Support › My custom post is not displaying date, author navigation etc like normal posts
- This topic has 11 replies, 3 voices, and was last updated 7 years, 5 months ago by
Tom.
-
AuthorPosts
-
June 2, 2018 at 7:34 am #590115
Pete
date, author, categories, tags, navigation
June 2, 2018 at 11:33 am #590314Tom
Lead DeveloperLead DeveloperHi there,
On your custom post type?
This might help: https://generatepress.com/forums/topic/custom-post-template-editing/#post-523368
Let me know 🙂
June 2, 2018 at 5:32 pm #590439Pete
Correct
June 2, 2018 at 6:44 pm #590460Pete
Great, thanks that works. Is there anyway we can have CPTs displaying this as default rather than having to add this?
Cheers
PeteJune 2, 2018 at 6:47 pm #590462Pete
It isn’t showing the post date?
June 2, 2018 at 9:05 pm #590515Tom
Lead DeveloperLead DeveloperYou can do this:
add_action( 'generate_after_entry_header', 'tu_cpt_top_meta' ); function tu_cpt_top_meta() { if ( 'your-post-type' === get_post_type() ) : ?> <div class="entry-meta"> <?php generate_posted_on(); ?> </div><!-- .entry-meta --> <?php endif; }There’s no way to do it without the code right now, but I’ll look into making it as simple as adding a filter.
June 2, 2018 at 9:06 pm #590516Pete
Yeah sorry I just realised the above code was for the footer not the header 🙂
June 2, 2018 at 9:11 pm #590518Tom
Lead DeveloperLead DeveloperYea sorry about that – using both functions should handle the header and footer 🙂
October 21, 2018 at 12:10 am #706229Satori
Hi! I was looking for info on how to add meta to CPT’s. I read about the possible filter to allow this level of compatibility. Just want to know if this is going to happen or we still have to do it old-school.
BTW can’t wait for the new GP 2.2 testing as I understand will bring more Gutenberg options.
October 21, 2018 at 9:21 am #706558Tom
Lead DeveloperLead DeveloperThere’s a filter in GP 2.2 that will allow you to do this:
add_filter( 'generate_entry_meta_post_types', function( $types ) { $types[] = 'my-post-type'; return $types; } ); add_filter( 'generate_footer_meta_post_types', function( $types ) { $types[] = 'my-post-type'; return $types; } );2.2 is a huge update – it’s going to need all the beta testing it can get 🙂
October 21, 2018 at 10:56 am #706626Satori
Thank you so much for this Tom! GP is definitely the way to go to develop amazing WordPress sites. I’ll help in beta all I can, that’s for sure.
October 21, 2018 at 6:02 pm #706806Tom
Lead DeveloperLead DeveloperThank you! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.