Site logo

Archived topic

How I can change Blog meta and Pagination like this

9 replies · Started by Amol Chavan on October 15, 2020

Viewing posts 1–10 of 10

Hello team,

I want to change the blog post meta and pagination as shown in the below images:

1. On Blog archive it should show like this: https://ibb.co/Z8gVW1n

2. On a single blog post it should show like this: https://ibb.co/KX4QRJt

3 Pagination: https://ibb.co/18gQgq0

Could you please help how to do this?

Thanks.
Regards,
Amol chavan

Thanks. I have pasted the code as per the example shown in the link which you have provided. But now it happens in reverse. i.e

Single blog post showing: Img Amol Chavan | October 9, 2020
Blog Archive Showing: Img Amol Chavan | Comments| October 9, 2020

It should be reverse:

Single blog post showing: Img Amol Chavan | Comments| October 9, 2020
Blog Archive Showing: Img Amol Chavan | October 9, 2020

I will raise a separate ticket for the navigation.

Any chance you can link us to the pages so we can take a look?

Thanks!

This looks like it's working? The archives are showing in two lines because there isn't enough horizontal space to fit it all on one line.

No Tom, It not working my expectation is it should be in this format:

Single blog post: Img Amol Chavan | Comments| October 9, 2020
Blog Archive: Img Amol Chavan | October 9, 2020

but its showing in the wrong swipe order

Single blog post: Img Amol Chavan | October 9, 2020
Blog Archive: Img Amol Chavan | Comments| October 9, 2020

Can you share the exact code you're using to build the meta so I can check it out?

Here it goes, I copied from GeneratePress Documentation guide:-

add_filter( 'generate_post_author_output', function() {
    return sprintf( ' <span class="byline">%1$s</span>',
        sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%4$s<a href="%1$s" title="%2$s" rel="author"><span class="author-name" itemprop="name">%3$s</span></a></span>',
            esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
            esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
            esc_html( get_the_author() ),
            get_avatar( get_the_author_meta( 'ID' ) )
        )
    );
} );

add_filter( 'generate_header_entry_meta_items', function() {
    return array(
        'author',
        'comments-link',
        'date',
    );
} );

add_filter( 'generate_footer_entry_meta_items', function( $items ) {
    return array(
        'categories',
        'post-navigation',
    );
} );

So you basically want the comments link to show on single posts, not archives?

If so, try this:

add_action( 'wp', function() {
    if ( is_singular() ) {
        add_filter( 'generate_show_comments', '__return_true' );
    } else {
        add_filter( 'generate_show_comments', '__return_false' );
    }
}, 100 );
This archived topic is closed to new replies.