Site logo

Archived topic

Author Link Redirects to Homepage

14 replies · Started by Rohan Verma on August 4, 2020

Viewing posts 1–15 of 15

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.

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?

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

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

Using Yoast.

Can you try disabling it?

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.

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

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

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

Now, kindly help on it. Issue remains.

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.

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

Author Archive was turned off by default.

No problem :)

This archived topic is closed to new replies.