Site logo

Archived topic

Relocating "category" below "date" on post archive page

5 replies · Started by Hardik on April 13, 2022

Viewing posts 1–6 of 6

Hello,

As the topic title suggests, I’d like to move the Categories position on the blog page. It should look like this:

– Post Title
– Date
– Post Categories
– Post Tags

Right now the Categories and Tags are displayed at the bottom:

Is there a way to simply move it up on the default archive page without redesigning the entire archive using the content-template block element?

Thanks!

Hi HD,

Thank you for creating a new topic.

Yes, you should be able to create such a layout through a Content Template - Block Element.

You may also want to check the templates available and see if any works for you: https://share.getcloudapp.com/nOuR1mpj

This could be possible through CSS as well. If you can provide the link to the site in question, I’ll try to see if I can provide a fix.

Either should work.

Hope this clarifies. :)

Thank you for your reply. I've shared the link in the private information area. Please let me know any quick fix if possible. Thank you!

Hi there,

add this PHP Snippet to add the category terms there:

add_filter( 'generate_header_entry_meta_items', function() {
    return array(
        'date',
        'categories',
    );
} );

and add this snippet to remove them for their current position:

add_filter( 'generate_footer_entry_meta_items', function( $items ) {
    return array_diff( $items, array( 'categories' ) );
} );

Hello!

Thank you for your time! I added the snippets, but they have some problems:

  1. No default icon on the left
  2. Appearing adjacent to date rather below

What could be done in this case? Thanks!

remove this:

add_filter( 'generate_header_entry_meta_items', function() {
    return array(
        'date',
        'categories',
    );
} );

And add this instead:

add_action( 'generate_after_entry_title', function() {
    generate_do_post_meta_item( 'categories' );
} );
This archived topic is closed to new replies.