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
Solved

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

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

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

Suggested Solutions

Title # Comments Views Activity
Gradient CSS 4 36
Allowing super admins to access to all user accounts 5 24
Website Interactive tool that will do calculations 3 59
Upload memory limit WordPress GoDaddy 8 37
What's this? As a volunteer Page Editor for Experts-Exchange.com, I have noticed that many authors also have blogs, and pull articles from their blogs to post at Experts-Exchange. I appreciate each author sharing their blog content with our site …
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

838 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