[Resolved] Author Link Redirects to Homepage

Home Forums Support Author Link Redirects to Homepage

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1387152
    Rohan Verma

    Hi, team.

    1. Whenever I click to author link from the single post or from the homepage author link (view all posts by author), it just redirects to the homepage every time.
    2. How can I get the same (view all posts by author) link on the single post author bio?

    Kindly help with it.

    #1387407
    Leo
    Staff
    Customer Support

    Hi there,

    1. That’s strange. It should go to the author archive by default as seen here:
    http://gpsites.co/marketer/

    Does it happen on the normal post loop without WP Show Posts as well?

    #1388371
    Rohan Verma

    Yes. From everywhere. Clicking on the author link redirects to homepage.

    #1388373
    Alexander

    Do you have any SEO plugins installed?
    I know that Rank Math for exampel have a feature where author link redirect to homepage.

    #1388378
    Rohan Verma

    Using Yoast.

    #1388402
    Leo
    Staff
    Customer Support

    Can you try disabling it?

    #1388426
    Rohan Verma

    Now, after deactivating and reactivating all disabled plugins, it seems that my author URL (admin) is working fine.

    But other assigned author link opens the homepage even after deactivating yoast and caching.

    #1388436
    Rohan Verma

    Still, I have deactivated Yoast and caching so that you guys can check.

    One thing I should mention that there is a snippet code I’m using that’s related to date and author image on a single post. I’m giving the code below. Take a look if something is conflicting.

    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&#8221; 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’ ) )
    )
    );
    } );

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

    #1388455
    Leo
    Staff
    Customer Support

    Can you disable all plugins and custom functions to eliminate any conflicts first?

    #1388508
    Rohan Verma

    Disabled all plugins except for GP Premium and WPSP. Disabled all PHP codes and custom CSS.

    Now, kindly help on it. Issue remains.

    #1388512
    Leo
    Staff
    Customer Support

    I actually just tested it and everything seems to work on my end:
    https://www.screencast.com/t/uYOsJj4NnibV

    What isn’t working for you?

    #1388623
    Rohan Verma

    But I think after adding the custom css codes, the same issue appears again.

    Can you kindly check the css codes which is causing the conflict?

    Because there are so many individual codes for styling. So, I shouldn’t remove all.

    #1388857
    Leo
    Staff
    Customer Support

    CSS would not cause issues like this.

    Are you saying the function here is causing the issue?
    https://generatepress.com/forums/topic/author-link-redirects-to-homepage/#post-1388436

    What was that function for?

    #1389195
    Rohan Verma

    I have managed to fix the issue. Thanks for suggesting that SEO plugin part.

    Author Archive was turned off by default.

    #1389695
    Leo
    Staff
    Customer Support
Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.