Solved

Wordpress - using authors first, last, name in url for a list of posts

Posted on 2011-09-03
5
257 Views
Last Modified: 2012-06-27
I would like to have links on my site that will go to a page that displays all of a users posts.

I have not used it in the past, but it looks like wordpress does it easily enough, apparently using the 'archive.php' page in my theme.

So I can have a url like this:  www.mysite.com/author/username  and it will display their posts very nicely.

Here's the problem I am dealing with though... in the past, some of my users choose different usernames than the names they write under. When writing, we list their first & last name as the 'author'.

So if I go with the way things are set up write now - the url might be www.mysite.com/author/andy  (the username being the author's real first name)  when the "author's name" on the post is Jacob Long. It makes it look a bit goofy.

Is there a way I can set wordpress up to use a url like this: www.mysite.com/author/firstName-lastname  to list the posts from that author?

Setting up the links is easy enough using:

$user->user_firstname . '-' . $user->user_lastname

in the url. But of course, that link does not work unless they happened to use their full name as their user name.

I'm not even sure if I would tackle this issue in the .htaccess, index.php, header.php, archive.php, or some wordpress file?

Thanks for any help on this,

Chris


0
Comment
Question by:St_Aug_Beach_Bum
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:PragmatiCoder
ID: 36481316
1. Go to your wordpress admin
2. Go to Settings->Discussion->Before a comment appears
3. Uncheck both options
0
 
LVL 5

Expert Comment

by:PragmatiCoder
ID: 36481317
Wrong question...
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 36481829
Well... barring changing it to using first name/last name,..

I could use the 'nicename', which it looks like is now called the 'nickname'?

But I'm getting something wrong or misunderstanding the direction at http://codex.wordpress.org/Author_Templates

I've change the file 'archive.php' to 'author-{nicename}.php', and then gone to the url mysite.com/author/adrian ('adrian') being the user's nickname in this case - and I get a 404 error.

I also tried changing the file to  'author-{nickname}.php' and got 404 on that as well.

I feel like I am missing something that's key to understanding how to do this... do I have to name the file using the actual nickname?
0
 
LVL 31

Accepted Solution

by:
gwkg earned 500 total points
ID: 36582950
All the author templates do is allow you to use a different template to display specific author pages.

What you are trying to do is change the author 'slug'

Something like this may help: http://wordpress.org/extend/plugins/author-slug/
0
 

Author Closing Comment

by:St_Aug_Beach_Bum
ID: 36583585
Yep, a plugin did the trick, actually ended up using this one: http://wordpress.org/extend/plugins/edit-author-slug/

but thank you :)  Chris
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now