Support » Fixing WordPress » author.php and spaces in usernames
10 years, 4 months ago
I am trying to code a static link into a forum profile which takes the user to the author.php for that profile. [The forum and WordPress share the same database].
I understand that the link has to be in this format:
however if the user name has spaces in, i can’t use that method.
is it possible to pass the user ID nubmer to author.php instead?
however if the user name has spaces in, i can’t use that method
Of course you can, you just need to encode the space as %20
you can either do that yourself when you make the links (blah) or write a simple function that uses str_replace to do it.
ok, i have that working OK but i still can’t get the link to pull the right posts.
for example: i am passing the author login to the link, but… this works:
this does not:
i think it would always work if i passed ‘user_nicename’. but do i need to? have i missed something silly here?