2
votes

Wordpress builds in the principle of the author page. The author page is fine and can collect information on the author with a nicename URL. It will not do this with users whom have not written posts.

I want an effective user page that I can theme, www.example.com/user/[user_nicename]. Simple I would have thought, but I cannot find anyway for the code to find the ID of the user which is needed to make this concept work. I cannot find a plugin either. Most provide a profile page for the logged in user only and not for reference of other users.

How can this be done.

2

2 Answers

0
votes

There are a few plugins to automatic user pages, did you try this one : http://wordpress.org/extend/plugins/wordpress-users/

0
votes

You can use mod_rewrite to change user/[user_nicename] to pass a GET variable to a php file where you can do a wordpress table search for user_nicename and get all the variables associated with the author. For this the author need not have written a post.

You could use something like this

<?php
$username = $_GET['user'];
if (isset($username))
{
$user_ids = $wpdb->get_col("SELECT * FROM $wpdb->users WHERE user_nicename = $username");
..

I have used something like this in one of my wordpress projects. Here is the example (not working now) to the user page I made. But there I used user id instead, for less load on sql query.