Site logo

Archived topic

Place the entry-header after the content

9 replies · Started by Takeru on February 14, 2021

Viewing posts 1–10 of 10

I want to place the entry-header after the content, what code do I need to add?

Hi there,

Not sure if I fully understand.

You are wanting to move the entire entry header (title, meta etc) to after the content?

Would this be for the entire site? or just single posts?

Only entry-meta.

I'm currently only displaying the date as entry-meta, but I want to place that date after the content.

It is about single posts.

I'm sorry, but I don't know the code, can you give me the specific code?

Hi there,

Can you specify which entry meta items do you want to move?

Here's an example usage of the filters Ying provided.

Say, you want to move ALL of the entry meta from the header entry meta to the footer entry meta, you can do it like this.

add_filter( 'generate_header_entry_meta_items', function() {
    return false;
} );

add_filter( 'generate_footer_entry_meta_items', function() {
    return array(
        'author',
        'date',
        'categories',
        'comments-link',
        'post-navigation',
    );
} );

Once applied, all the entry metas will display stacked on the footer meta like this: https://share.getcloudapp.com/2NuEENxL

Worked well, thank you!

However, there seems to be a warning in part of the code.

I will describe it in Private information.

Can you try replacing this:

add_filter( 'generate_header_entry_meta_items', function() {
    return false;
} );

With this?

add_filter( 'generate_header_entry_meta_items', function( $items ) {
    return array_diff( $items, [ 'date','author' ] );
} );

Let us know if the error still occurs.

It worked, thank you!

No problem. Glad you got it sorted. :)

This archived topic is closed to new replies.