How to change the author link format
-
The DW Q&A plugin produces links to author/questioner pages in this format:
https://mywebsite.com/questions/?user=username
In my custom theme, multisite, I need them to be in this format:
https://mywebsite.com/username
I had added this to functions.php, based on a function in Buddypress:
function modified_author_link ( $user_id = 0, $user_nicename = false, $user_login = false ) { if ( empty( $user_id ) ) { return; } $user_info = get_userdata( $user_id ); $username = $user_info->user_login; $domain = trailingslashit( network_home_url() . '/' . $username ); return $domain; } add_filter( ‘author_link’, ‘modified_author_link’ );
But it doesn’t do anything. What am I doing wrong? Other suggestions?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to change the author link format’ is closed to new replies.