Support » Fixing WordPress » subscriber profile

  • I have added a author template in the hopes of allowing all registered users regardless of role a profile page on the site. Here is the profile page of one of the admin level users:

    FYI, here is the code that I have used to do this (in author.php template):

    if(get_query_var('author_name')) :
    $curauth = get_userdatabylogin(get_query_var('author_name'));
    else : $curauth = get_userdata(get_query_var('author'));
    <h3><?php echo $curauth->nickname; ?></h3>
    <p><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></p>
    <h4>About <?php echo $curauth->nickname; ?></h4>
    <p><?php echo $curauth->user_description; ?></p>
    <h4>Other Users:</h4>
    <?php wp_list_authors('hide_empty=0&exclude_admin=0'); ?>

    I added the wp_list_authors just for testing, this will be removed once (if?) I can get this to work properly.
    As you can see from the list of users, only 2 (both admin level) have links to their profiles. I have tried substituting the username in the url but it just comes up with a 404 page.

    Is there any way that I can override WordPress’ restriction limiting profile pages to those of author level or above?

    And a couple of side questions:
    Why does WordPress allow subscribers to fill out the profile at all (as well as see dashboard, etc.) if their profile can never be seen?

    Is the only benefit of registering that you don’t have to fill out comment fields (which is also done with cookies for those who aren’t registered so its not that much of a benefit)?

    Thanks for your help.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Registration seems to give admin some control over spammers. See “Users must be registered and logged in to comment” option.

    I’m largely unfamiliar with the newer 2.x+ versions, so can’t really help with other questions. Roles came with 2.0, if I recall correctly.

    I’m pretty sure the “Users must be registered and logged in to comment” has no effect on whether profile pages are active or not. I also believe the behavior I have described (no profile output page for lower access levels, but ability to edit profile, see limited areas of admin) was also present before the 2.0 additions of roles and capabilites.

    klklaser – I shouldn’t have posted so fast, I understand what you are saying, with that setting, registering offers the benefit of being able to post. Good point.

    About Current Author

    “It is important to know that $curauth is not a WordPress variable, but a variable generated by PHP code and sent via a link as a query. Therefore, the author.php file must be requested via a link to the author page, which specifies an author. If you request the author.php page directly, you’ll end up with no data.

    Maybe there are ideas here, or here.

    I have no idea whether that can adapt to your use or not.

    Anyone have an update on this? (For being able to display subscriber profiles with the author.php page)

    Same issue here. I can get a nice list of authors and contributors:

    <h2>List of authors:</h2>
    <?php wp_list_authors('hide_empty=0'); ?>

    …however the only ones that are linked to actual profile pages are the ones who have written a post. It doesn’t matter if they are authors or contributors….it just matters if they have posted or not…no posts, no profile. Does anyone know a way around this?

    Steven Chang


    To get around this problem, you’ll have to modify wp-include/class.php function handle_404().

    Find this line:
    if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER[‘QUERY_STRING’]) && (false === strpos($_SERVER[‘REQUEST_URI’], ‘?’))) ) ) {

    and include negative qualifier for author pages:

    if ( (0 == count($wp_query->posts)) && !is_404() && !is_author() && !is_search() && ( $this->did_permalink || (!empty($_SERVER[‘QUERY_STRING’]) && (false === strpos($_SERVER[‘REQUEST_URI’], ‘?’))) ) ) {

    That should do it for you. Hope that helps.

    [sig moderated]

    This was very helpful. Thank you!

    Now all I need to do is figure out how to produce the profile links.

    Thanks codersteve. Thanks thanks thanks thanks 🙂

    This is great. I’ve started to edit the default Archive page, but what I’d like to do is to include “subscribers” who have posted comments, but I can’t figure out how to do that. Anyone feeling clever?


    Oh, and Edit: codersteve, when using that code to get around the 404, my post url’s, comments and what nots gets a 404 instead.

    OK, never mind that edit, I think I was just sitting up working too late, not realizing my head went to bed hours earlier…

    But in addition to including Subscribers to these author pages, I would like to see this author thing move up a level, to the main “Root Blog” if you will.

    Right now, I have installed my blog under /wpmu. I have one blog as /wpmu/blog1 and another as /wpmu/blog2. So, if admin1 posts an entry under say blog1, you can only access his profile page under /wpmu/blog1 at URL /wpmu/blog1/author/admin1.

    I would love to get his profile page accessible under /wpmu/author/admin1, meaning at “root level”. I don’t know if this could be achieved by mod_rewrite or something, but I have no idea how.

    Further more, since these author pages are blog dependent as far as posts go, if you visit /wpmu/blog2/author/admin1 there will be no content, since he never posted on blog2. But he, and any subscribers I tested with, have access to post comments on both (I guess ALL) blogs, by signing up.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘subscriber profile’ is closed to new replies.