Archived topic
Change position meta data on single posts
9 replies · Started by Evita on July 5, 2019
Hello there,
I'm changing the position of my meta data on single posts:
- Post category above post title
- Post date and tags on bottom of single post
1. I used this topic to move the post category above the post title (this worked well for me):
https://generatepress.com/forums/topic/putting-blog-post-category-on-top/
2. And I used the Github code (only post date & tag code) from this topic:
https://generatepress.com/forums/topic/move-author-date-to-the-bottom-after-content/
However.. number 2 is a bit tricky. In my single posts I use multiple hooks in the "after_content" area. Currently the post date & tags appear above these hooks.
I would prefer to use a hook to display the post date and tags, so I can prioritize this hook and put it at the very bottom of the post content. How should I approach this?
Hi there,
We can actually do this for the footer meta:
https://docs.generatepress.com/article/generate_footer_entry_meta_items/
Let me know if this helps :)
Hello Leo,
Thank you for your reply!
I activated the code from the Documentation page. The meta data appears above two hooks which I inserted in the "after_content" area. Is there a way to show the meta data below these hooks?
The post date is also present below the post title. Is there a way to remove it? If I change the Customize settings and remove the post date from single posts, it disappears at the bottom of the post too.
Instead of using after_content, can you try adding those two hooks using after_entry_content like this?
https://www.screencast.com/t/wKwdqlyrHWN
Let me know :)
Thank you for the suggestion! Yes, that worked for me to change the order of the hooks :)
About the post date: it appears twice in the single posts now (below post title & post bottom). Do you know how I can prevent it from showing up below the post title? I only need to display the post category above the post title (which I found a solution for in another topic).
Can you try unchecking the option here?
https://docs.generatepress.com/article/blog-content-layout/#archives
Let me know if it hides both...
Hello Leo,
I've unchecked the post date option for single posts. The post date below the post title has disappeared, but the post date at the post bottom too. Plus the post category is now missing (above the post title).
For the post category I used this topic:
https://generatepress.com/forums/topic/putting-blog-post-category-on-top/
This should remove it from below the post title:
add_filter( 'generate_header_entry_meta_items', function( $items ) {
return array_diff( $items, [ 'date' ] );
} );
Let me know :)
Hello Tom, that worked for me :)
Thank you both for your support!
Glad we could help :)