I am trying to create a profile page for every user if his / her role is a custom role.
Ive created a custom role in my site. Now this is the default role is assigned to the members when they register on the site.
I have contributors.php
and authors.php
.
If I go to www.mysite.com/authors
it lists all the users without considering the role.
Then I used Author Base using generate_rewrite_rules
to rewrite this URL.
Now if I go to www.mysite.com/mycustomrole
it lists all the users. It's fine for me.
Next step to create a profile page for each members. So I've created author.php
When I have the users below,
- user1 - administrator
- user2 - custom role
- user3 - administrator
- user4 - custom role
I am able to see thier profile page like this.
- If I go to
www.mysite.com/authors/user1
it shows his profile. - If I go to
www.mysite.com/authors/user2
it does not show his profile. - If I go to
www.mysite.com/authors/user3
it shows his profile. - If I go to
www.mysite.com/authors/user4
it does not show his profile.
So I am getting individule profile page only for administrator
role user and not for my custom created role
users.
Why is that.
For now my requirements are:
- I want to get the URL for an individual custom user like :
www.mysite.com/customrole/user1
- I want to get the URL for an individual custom user like :
- I want to show the custom role users only under that URL. but it's fine if I am able to show other role users too under that url.
How can I do this WOTHOUT using any plugins?
user1
anduser3
"it does not show his profile." Exactly what does that mean? Is the templateauthor.php
still being displayed, but with incorrect information, or are you recieving a404
error?custom role
user. Issue with their profile page only.www.mysite.com/authors/user2
If I go to this page.. It just shows a blank page...No Posts By This author
for user1 and user2 (forwww.mysite.com/authors/user2
andwww.mysite.com/authors/user4
) But one post was posted by each of thiscustom role
users. and Note those posts alsocustom post types
suppose is this the reason?