[Resolved] Remove author link

Home Forums Support [Resolved] Remove author link

Home Forums Support Remove author link

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1605406
    Matthew

    Hi,

    I’ve used the Entry Meta Style, Example 1, from this link here:

    https://docs.generatepress.com/article/entry-meta-style/

    I’d like to remove the author link, but the advice I’ve seen in other forum posts doesn’t seem to work for this situation.

    Is there a way of doing it?

    #1605642
    David
    Staff
    Customer Support
    #1606278
    Matthew

    Hi David,

    Unfortunately, the code given there also results in the gravatar image not displaying.

    Is there anything else I can try?

    #1606872
    Leo
    Staff
    Customer Support

    Replace this snippet:

    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' ) )
            )
        );
    } );

    with this:

    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<span class="author-name" itemprop="name">%3$s</span></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' ) )
            )
        );
    } );
    #1608146
    Matthew

    Thanks Leo

    #1608598
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.