Site logo

Archived topic

Change position meta data on single posts

9 replies · Started by Evita on July 5, 2019

Viewing posts 1–10 of 10

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?

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.

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).

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 :)

This archived topic is closed to new replies.