Home › Forums › Support › How can I move the tags so they are at the top of the post, below the author?
- This topic has 5 replies, 2 voices, and was last updated 3 years, 6 months ago by Elvin.
-
AuthorPosts
-
September 28, 2020 at 12:51 pm #1462796Anne
I’d like to change the location of the tags from the bottom of posts to the top of posts, just below the author.
I looked through the settings but didn’t notice any option for that.
Is there an easy way to achieve this?
Thanks!
September 28, 2020 at 1:09 pm #1462814ElvinStaffCustomer SupportHi Anne,
You can go to these pages to get references on what codes to use.
https://docs.generatepress.com/article/generate_header_entry_meta_items/
https://docs.generatepress.com/article/entry-meta-style/You can also follow this topic’s solution. It’s pretty similar.
https://generatepress.com/forums/topic/change-metadata-order-on-blog-archives/#post-1345450The solutions are PHP filters. Here’s how to add PHP – https://docs.generatepress.com/article/adding-php/
September 28, 2020 at 2:48 pm #1462904AnneThat was a big help thanks. I am using a child theme so i can just add my snippets right to the functions.php which is easy – except the snippet in the topic you linked didnt work for me.
This array does work for me tho:
add_filter( 'generate_header_entry_meta_items', function( $items ) { if ( is_single() ) { $items = array( 'author', 'tags', ); } return $items; } );
However, it displays the author and tags inline where as id rather the author be its own line. Is this better to achieve with alterting the snippet or just css?
Nevermind i just achieved it using css.
However, the :before css I have styled to the tags at the end of the post isnt being applied to the same tags at the top:
.tags-links:before { font-family: inherit; content: "Tags:"; width: auto; }
It’s missing the ‘Tags:’ Content but thats not really a big deal i guess. Just curious if you can figure out why that is?
September 28, 2020 at 3:20 pm #1462914ElvinStaffCustomer SupportNevermind i just achieved it using css.
Nice one. That’s actually the way to go.
However, the :before css I have styled to the tags at the end of the post isnt being applied to the same tags at the top:
.tags-links:before { font-family: inherit; content: "Tags:"; width: auto; }
It’s missing the ‘Tags:’ Content but thats not really a big deal i guess. Just curious if you can figure out why that is?
You’ll have to add
display:inline-block;
. 🙂September 28, 2020 at 7:24 pm #1463019Annelovely thank you guys again for the support! Solved.
September 28, 2020 at 7:35 pm #1463027ElvinStaffCustomer SupportNice one!
No problem. Always glad to be of any help. 😀
-
AuthorPosts
- You must be logged in to reply to this topic.