Editing the variables in a custom URL
IMHO easiest way to do the trick is use a simple rewrite rule, and demand the logic to the page, e.g. function my_custom_url() { add_rewrite_rule(‘story/([^/]+)/?’,’index.php?pagename=story&user=$matches[1]’,’top’); } add_action( ‘init’, ‘my_custom_url’ ); After that in page where you need the user id use: $userqv = get_query_var(‘user’); $user = is_numerical( $userqv ) ? $userqv : get_user_id( $userqv ); … Read more