Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How to redirect to user profile

@alexandra55

Participant

It seems that this might work

/* check if custom function file is active */
if( file_exists( WP_CONTENT_DIR . ‘/meso-custom-functions.php’ ) ) {
include_once( WP_CONTENT_DIR . ‘/meso-custom-functions.php’ );
}

add_action( ‘template_redirect’, ‘authorblog_template_redirect’ );
function authorblog_template_redirect(){
if(is_author()){
if(get_query_var(‘author_name’)) :
$curauth = get_user_by(‘slug’, get_query_var(‘author_name’));
else :
$curauth = get_userdata(get_query_var(‘author’));
endif;
wp_redirect(‘http://www.your wesite name/members/’. $curauth->nickname );
}
}

Skip to toolbar