[Resolved] How I can change Blog meta and Pagination like this

Home Forums Support [Resolved] How I can change Blog meta and Pagination like this

Home Forums Support How I can change Blog meta and Pagination like this

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1490899
    Amol Chavan

    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

    #1490921
    Leo
    Staff
    Customer Support

    Hi there,

    For the meta request, check out this example:
    https://docs.generatepress.com/article/entry-meta-style/

    As for the pagination, can you open a separate topic for it?

    Thanks!

    #1491716
    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.

    #1492314
    Tom
    Lead Developer
    Lead Developer

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

    Thanks!

    #1494157
    Amol Chavan

    Here are the pages:

    Single blog post showing: https://www.growthfunda.com/influencer-marketing-tools/
    Blog Archive Showing: https://www.growthfunda.com/blog/

    Thanks.

    #1494692
    Tom
    Lead Developer
    Lead Developer

    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.

    #1498638
    Amol Chavan

    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

    #1498914
    Tom
    Lead Developer
    Lead Developer

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

    #1499192
    Amol Chavan

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

    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 );
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.