Archived topic
Post meta category - move location?
7 replies · Started by Alf on January 29, 2020
Is there a way to move the post category meta up to the post date and post author? I.e underneath post title?
Thanks!
Hi there,
Try this filter:
https://docs.generatepress.com/article/generate_header_entry_meta_items/
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know if this helps :)
Great, thanks!
No problem :)
Just a follow-up,
I have added the suggested filter:
add_filter( 'generate_header_entry_meta_items', function() {
return array(
'categories',
'date',
'author',
);
} );
(adding it using Code Snippets). However, the category is still visible below the post (both on single post and archive frontpage. Is there a way to filter this location out?
And is it possible to add a "," between the category and post date?
Thanks again!
Hi there,
You can remove it from the footer like this:
add_filter( 'generate_footer_entry_meta_items', function( $items ) {
return array_diff( $items, [ 'categories' ] );
} );
To add a comma, try this:
add_filter( 'generate_category_list_output', function( $output ) {
return $output . ', ';
} );
Excellent, thank you!
You're welcome :)