Site logo

[Resolved] Removing author link

Home Forums Support [Resolved] Removing author link

Home Forums Support Removing author link

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1074999
    gedosan

    Hi there

    I tried this code to remove the author link:

    add_filter( ‘generate_page_hero_post_author’, function() {
    global $post;
    $author_id = $post->post_author;

    return sprintf( ‘<span class=”author vcard” itemtype=”http://schema.org/Person&#8221; itemscope=”itemscope” itemprop=”author”><span class=”author-name” itemprop=”name”>%s</span></span>’,
    esc_html( get_the_author_meta( ‘display_name’, $author_id ) )
    );
    } );

    It worked on some pages, but not on these (see below). Can you take a look please

    Thanks

    G

    #1075031
    Leo
    Staff
    Customer Support

    Hi there,

    The code you are using removes the author link inside of page hero.

    Try this as well:
    https://docs.generatepress.com/article/generate_post_author_output/#remove-link

    #1075194
    gedosan

    Perfect thanks

    #1075206
    Leo
    Staff
    Customer Support

    No problem 🙂

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