• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 991
  • Last Modified:

WordPress: How do I bring in just the author name and not the author's name with a link to all their archived posts?

I am trying to bring in a posts author without a link to all the authors archived posts so I can instead include a link to the author's google+ profile.

Here is the current code:
Posted in: <?php the_category(',');?> by <?php the_author_posts_link();?> &nbsp; | &nbsp; <?php comments_popup_link('0 Comment','1 Comment','% Comments');?>

Open in new window


Here is what I thought it would be, but the get_the_author call doesn't bring in anything.
Posted in: <?php the_category(',');?> by <a rel="author" href="https://profiles.google.com/mygoogleID" target="_blank" title="Visit my Google+ Profile"><?php get_the_author();?></a>  &nbsp; | &nbsp; <?php comments_popup_link('0 Comment','1 Comment','% Comments');?>

Open in new window


I'm also wondering if there is a way to bring in any of the other author's profile fields.
0
Jules Webb
Asked:
Jules Webb
  • 4
  • 3
2 Solutions
 
singletonCommented:
If I am reading this correctly you are trying to generate

<a href="link1"><a href="link2">xxx</a></a>

And a link cannot contain another link

See http://codex.wordpress.org/Function_Reference/the_author_posts_link

the_author_posts_link() is located in wp-includes/author-template.php

You have not indicated which theme you are using
0
 
Jules WebbAuthor Commented:
I removed the_author_posts_link () because I don't want to link to archive of authors posts

I was hoping that get_the_author()  was only meant to only get the author as opposed to the_author_posts_link () which gets the author and creates a link to page with posts written by author.

browser renders:
Posted in: category 1 by fname lname   |   0 Comment

Category 1 will link to mysite.com/category/category-1
fname lname will be a link to google+ profile
comment will link to mysite.com/blog/post-name#respond

In the related articles section of the page you referenced I found Function Reference/the author: the_author()

I also found Function Reference/the author meta in the related articles section and was able to work out how to bring in the googl+ url dynamically by using the user website field to store the google+ profile link.

My final version that works and does everything I need it to do.
<?php the_category(',');?> by <a rel="author" href="<?php the_author_meta('user_url'); ?>" target="_blank" title="Follow <?php the_author_meta('user_firstname'); ?> on Google+"><?php the_author();?></a> &nbsp; | &nbsp; <?php comments_popup_link('0 Comment','1 Comment','% Comments');?>

Open in new window


I'm thinking about adding a user custom profile field as explained here: http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields
But that's another enough for now.

Thank you for pointing me in the right direction, I didn't see those related links before.

Cheers
Jules
0
 
Jules WebbAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for JulesWebb's comment #37707652
Assisted answer: 500 points for singleton's comment #37707015

for the following reason:

singleton questions lead me to find my own answer, which I included so anyone else interested would know how I resolved the issue.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
singletonCommented:
That is what we are here for. I am going to object simply because it seems to indicate that the question will just be closed, but not PAQed (i.e. be a Previously Answered quesion for others to see), and you indicated you wanted others to see what you finally decided.
0
 
Jules WebbAuthor Commented:
Thanks singleton, I didn't understand about "PAQed" Can you tell me what action I'm suppose to take?
0
 
singletonCommented:
no they just changed the software but a moderator should show up
0
 
singletonCommented:
So the question will be PAQed?  That was all that was unclear to me
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now