• I’m having issues in WordPress when using the the_author_posts_link function.

    Basically I have users that have special characters or spaces on their names, such as “Bufón” or “Kogi Kaishakunin” and the link that is returned by this function takes me to a 404 page.

    See the examples here:

    https://www.coliseoweb.com/author/Buf%C3%B3n/ https://www.coliseoweb.com/author/Kogi%20Kaishakunin/

    How can I fix this? I know that replacing the “ó” with a “o” solves the issues for the special character username, but I can’t figure out the blank space one (I’ve tried a dash or removing the blank space).

    Any help on how to solve this please? How can I change that function to work correctly? Should I use another function instead?

    Thanks!

    Javier

    PS: I even tried this: <a href="<?php echo '/author/'.get_the_author_meta('user_nicename'); ?>" title="<?php the_author(); ?>" rel="author"><?php the_author(); ?></a> and it didn’t work out, same issue for spaces…

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘the_author_posts_link returns 404 on WordPress’ is closed to new replies.