[Resolved] Making author link on posts not clickable

Home Forums Support [Resolved] Making author link on posts not clickable

Home Forums Support Making author link on posts not clickable

  • This topic has 7 replies, 3 voices, and was last updated 5 years ago by David.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #829033
    Kevin Wabiszewski

    Hello, is there a way to make the author’s name and the date on posts not clickable?

    Thanks again for your help.

    #829035
    Leo
    Staff
    Customer Support
    #829062
    Kevin Wabiszewski

    Hi Leo, if this is too much to ask don’t worry about it. I know this doesn’t really fall into the scope of support but I tried adding that code and it did add the unclickable author name and date, but there were 2 of them since I am currently using this code. I think some of the fields as slightly different.

    add_filter( ‘generate_post_author’, ‘__return_false’ );
    add_filter( ‘generate_post_date_output’, function( $date ) {
    printf(
    ‘<span class=”meta-gravatar”>%s</span>’,
    get_avatar( get_the_author_meta( ‘ID’ ) )
    );

    echo ‘<span class=”meta-data”>’;

    printf( ‘ <span class=”byline”>%1$s</span>’,
    sprintf( ‘<span class=”author vcard” itemtype=”http://schema.org/Person&#8221; itemscope=”itemscope” itemprop=”author”><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() )
    )
    );

    echo $date;

    echo ‘</span>’;
    } );

    #829300
    David
    Staff
    Customer Support

    Hi there,

    you can disable the pointer events using this CSS:

    .byline .author a {
        pointer-events: none;
    }
    #829807
    Kevin Wabiszewski

    Thanks guys!

    #829814
    David
    Staff
    Customer Support

    You’re welcome – glad we could be of help

    #829825
    Kevin Wabiszewski

    Then just

    .posted-on a {
    pointer-events: none;
    }

    To disable the date link right?

    #829829
    David
    Staff
    Customer Support

    thats correct

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