I’m using the the_author_posts_link template tag. What I need to do is modify the actual URL; right now, it’s using the username, eg. myblog.com/author/admin but I want myblog.com/admin, or even better, myblog.com/authornickname.
Is there a plugin out there that can handle this? If not, can someone point me towards how I would write this? I’ve done a lot of PHP/MySQL before…
Setting urls from site/author/authorname to site/authorname is not a PHP/MySQL thing. It’s a .htaccess/mod_rewrite thing affecting your custom permalinks. The only way I imagine doing this is to add lines to your .htaccess, for example:
You would have to add one for each author you want to link to in this way. This is because pattern matching performed on custom urls take a non-declared top-level directory name (i.e. /admin) to be a Page, and nothing else. Modifying this action (as well as switching to nickname) would require changes to the WP core.
Finally, to create a link on a post for this, you can combine a couple template tags: