Solved

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

Posted on 2011-09-03
5
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are looking for plug-ins to add functions to your WordPress small business web site, take some time to read though this comprehensive list.  These are all the plugins I use for my customers WordPress web sites, as well as my own.  Be sure to …
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

617 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