[Resolved] Change position meta data on single posts

Home Forums Support [Resolved] Change position meta data on single posts

Home Forums Support Change position meta data on single posts

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #949646
    Evita

    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?

    #949907
    Leo
    Staff
    Customer Support

    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 πŸ™‚

    #950624
    Evita

    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.

    #950778
    Leo
    Staff
    Customer Support

    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 πŸ™‚

    #950845
    Evita

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

    #950846
    Leo
    Staff
    Customer Support

    Can you try unchecking the option here?
    https://docs.generatepress.com/article/blog-content-layout/#archives

    Let me know if it hides both…

    #950990
    Evita

    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/

    #951278
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #951673
    Evita

    Hello Tom, that worked for me πŸ™‚

    Thank you both for your support!

    #952113
    Tom
    Lead Developer
    Lead Developer

    Glad we could help πŸ™‚

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.