Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-10
9
Medium Priority
?
986 Views
Last Modified: 2012-03-18
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
Comment
Question by:Jules Webb
[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
  • 4
  • 3
9 Comments
 
LVL 11

Assisted Solution

by:singleton
singleton earned 2000 total points
ID: 37707015
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
 
LVL 2

Accepted Solution

by:
Jules Webb earned 0 total points
ID: 37707652
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
 
LVL 2

Author Comment

by:Jules Webb
ID: 37707693
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:singleton
ID: 37707694
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
 
LVL 2

Author Comment

by:Jules Webb
ID: 37707726
Thanks singleton, I didn't understand about "PAQed" Can you tell me what action I'm suppose to take?
0
 
LVL 11

Expert Comment

by:singleton
ID: 37708019
no they just changed the software but a moderator should show up
0
 
LVL 11

Expert Comment

by:singleton
ID: 37717076
So the question will be PAQed?  That was all that was unclear to me
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

664 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