[Resolved] Move Author, Date to the bottom – after content.

Home Forums Support [Resolved] Move Author, Date to the bottom – after content.

Home Forums Support Move Author, Date to the bottom – after content.

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #263037
    Tom
    Lead Developer
    Lead Developer

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

    #263111
    Tim

    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

    #263187
    Tom
    Lead Developer
    Lead Developer

    That un-styled post helps.

    So, this function is currently active on your website?: https://gist.github.com/generatepress/cf95fae85d5e7773d97a

    How are you adding it?

    #263443
    Tim

    My fault, did not realize I had to activate “Code Snippet” snippet, it’s working now

    Thanks

    #263492
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #1165917
    Milos

    Hi Tom, when i want to activate this code, i see this message:

    Cannot redeclare function generate_entry_meta.

    I use this code https://gist.github.com/generatepress/cf95fae85d5e7773d97a

    Can you help me? Thanks

    #1166355
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #1181422
    Milos

    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

    #1181913
    Tom
    Lead Developer
    Lead Developer
    #1183938
    Milos

    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?

    #1184193
    Tom
    Lead Developer
    Lead Developer

    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',
                );
            } );
        }
    } );
    #1184346
    Milos
    #1184950
    Tom
    Lead Developer
    Lead Developer

    Try this CSS:

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

    Now its ok, thanks.

    #1185395
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

Viewing 15 posts - 16 through 30 (of 30 total)
  • You must be logged in to reply to this topic.