Leo
(@leohsiang)
Hi, I used the code from the page you mentioned and it works. But he’s got a problem. The author’s link redirects me to the main page. You can see it here:
https://www.salvianatural.com/verticillata/
I’m sorry again.
I found that the problem was the YOAST SEO redirecting me to home.
I have fixed it but now it sends me to a page where it says “no result found”.
Leo
(@leohsiang)
I just tested the code on my install and it worked on my end – the author shows and direct me to the author page.
Can you try #1 here to eliminate any plugin conflicts first?
https://docs.generatepress.com/article/debugging-tips/
Let me know 🙂
Hello again,
I tried to remove all the plugins and it still doesn’t work.
I have activated debug mode and I don’t get any errors.
I activated the wordpress theme Twenty Seventeen and it doesn’t work there either.
Any other ideas?
Leo
(@leohsiang)
I feel like YoastSEO has something to do with it.
Can you see if this post helps?
https://generatepress.com/forums/topic/problem-author-page/#post-332240
If not I’d recommend checking with Yoast’s support and see if they have any clues.
Hello again,
I have already found the problem and it is not YOAST SEO.
I’m creating all the content with pages and not with posts.
As there is no posts created, the author page finds no results. That’s the problem here.
Is there any solution for the author page to show the pages created?
Thank you
Theme Author
Tom
(@edge22)
You could try adding a function like this:
add_action( 'pre_get_posts', function( $query ) {
if ( ! is_admin() && $query->is_main_query() && $query->is_author() ) {
$query->set( 'post_type', array( 'post', 'page' ) );
}
} );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know 🙂