Y
Y
Yuriy2017-02-21 11:53:06
WordPress
Yuriy, 2017-02-21 11:53:06

How to make user page address in wordpress?

How to make your user page URLs in wordpress.
There is a user profile template, now the access address to this page looks like this
http://site.ru/id123456

add_action('init', 'do_rewrite');  
function do_rewrite(){
    add_rewrite_rule('^id([^/]*)?$','index.php?pagename=user&id=$matches[1]','top');

how to do it without id prefix?
like this:
http://site.ru/123456
or
http://site.ru/username
http://site.ru/pupkin
http://site.ru/vasya

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuriy, 2017-02-21
@yous

U.P.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question