As a WordPress newbie I am trying to create a plugin, which will force users to specify their city and gender while registering and then display a personal profile page for each user showing this information.
I have checked in my plugin in GitHub: wp-city-gender.php.
For the registration part I have followed the Customizing the Registration Form doc and it seems to work fine – the additional city and gender fields are displayed in the registration form and stored later in the wp_usermeta
table. They are also editable in the Users part of the dashboard:
Also, I redirect commenter links to /user/user_id
by using this code:
define('PROFILE', '<a href="/user/%d" rel="external nofollow" class="url">%s</a>');
function get_comment_author_link($cid) {
global $comment;
return sprintf(PROFILE, $comment->user_id, $comment->comment_author);
}
add_action('get_comment_author_link', 'get_comment_author_link');
My question is: How can I add a personal profile page for each user, displaying his/her name and the 2 additional fields?
What I don’t want: I can not just create a plain PHP script fetching data from wp_usermeta
for a certain numeric user_id
– because it wouldn’t be integrated in my WordPress website, i.e. it won’t display the logo at the top and the footer at the bottom.