2

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.

Walrus
  • 19,801
  • 35
  • 121
  • 199

2 Answers2

0

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

Justin T.
  • 3,643
  • 1
  • 22
  • 43
0

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.

PRYM
  • 513
  • 4
  • 12
  • 1
    I know this is an old thread, but do you have the rest of the code, including the part for mod_rewrite for "pretty" URLS, and how this would be called? For example like in functions.php? I'm looking for something like this. A users page, separate from artist page. – Pat Mar 15 '13 at 01:01