Site logo

Archived topic

Move Author, Date to the bottom - after content.

29 replies · Started by Ramesh Srinivasan on February 4, 2016

Viewing posts 16–30 of 30

GP can only control code added by itself - it can't control text you've added manually into the post.

Hello Tom,

I think I have been confusing in what I am asking for by manually adding the Author and Date in the post or I miss understand what the PHP code is doing

Here is an unstyled post that might be clearer
http://aaa.greaterthanthesum.com/types-trust-networks/

Here is what I want to do
https://nimbus.everhelper.me/client/notes/share/719865/9gurmklveg8af9f4nqs9
https://nimbus.everhelper.me/client/notes/share/719882/skg1nkun65qaxmfvqkvw

Is this what the PHP code does? If so it is not working

Thanks

My fault, did not realize I had to activate "Code Snippet" snippet, it's working now

Thanks

You're welcome :)

Hi there,

There's an easier way to do it now:

add_filter( 'generate_header_entry_meta_items', '__return_empty_array' );

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

Let me know :)

Thanks Tom. When I activate this code, meta data are in the bottom - thats ok, but in header under title I have an error:

Warning: Invalid argument supplied for foreach() in ...wp-content/themes/generatepress/inc/structure/post-meta.php on line 279

Hi Tom, now it is better, but the date and author is not in the line, can you fix it?

And second problem, after I activate this code, on archive post date and author is missing :( Its possible make changes only on post page and let the others as it was?

Can you link me to the post where they're not in line?

For the second question, try updating the code to this:

add_action( 'wp', function() {
    if ( is_single() ) {
        add_filter( 'generate_header_entry_meta_items', '__return_empty_array' );

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

Try this CSS:

footer.entry-meta .byline, 
footer.entry-meta .posted-on {
    display: inline-block;
}

Now its ok, thanks.

You're welcome :)

This archived topic is closed to new replies.