Solved

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

Posted on 2011-09-03
5
263 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

730 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