Override default url for author pages?

So the default url to display a list of posts by a particular author looks like this:

http://domain.com/author/{username}

Read More

I am wondering how to change the ‘author’ in that url to something else?

I am working on a website for a charter school and they would like to allow each teacher to have a list of posts by “classroom”. So the desired url would be

http://domain.com/classroom/{username}

Related posts

Leave a Reply

4 comments

  1. You can add this in your functions, and it will rewrite the slug from default “author” to “classroom”,

    function new_author_base() {
        global $wp_rewrite;
        $author_slug = 'classroom';
        $wp_rewrite->author_base = $author_slug;
    }
    add_action('init', 'new_author_base');
    

    hope it helps you