I reviewed all related questions but none tackle this exactly so I’m posting the question in hopes the pro’s know how to handle this. I would like to change the author slug to remove the term /author/ completely like this;
currently example.com/author/username
want example.com/username
Moreover I’d like all posts related to an author to look like:
example.com/username/post-title
URl strucutres would resemble a.) either wpmu or b.) cpt without actually building either.
To add more context. I’m building a multi author blog where users have independent pages (author pages) that they can build, post, and share. All posts created by all authors will be included in the main loop (for now).
What’s my best case scenario and worse case scenario to achieve this?
Just an idea: Use a MU installation and give the blog names the names of the authors (use Sub-directories). This way you should get much closer to what you want to achieve with on board stuff.
This means that you’ll get your author names appended to the original domain and when you go there, you’ll see their blog pages = author posts.
This solution would avoid any sort of programming.
One way to achieve this (and you have to be willing and able to hack WP) is the following:
Part 1 – after an author posts a new post, you explicitly change the post GUID in the database. Here is a crude example/outline:
This changes the GUID of the post in the DB – now comes the interesting part.
Part 2 – add/edit index.php in your theme to handle your custom URLs. Here’s an outline:
basically what you are doing here is looking for the GUID you explicitly set earlier before WP handles things the ‘usual’ way. If $post is not empty you can now take it from there.
I am working on a complete post outlining this solution as we implemented it at Litefort for a service we are creating, check out developers.litefort.com for more.