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
969 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 500 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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert complicated date to yyyy-mm-dd format 22 53
Load string Array from file 23 42
Last 4 numbers of a variable 9 21
Doubt with angularJs with PHP 4 19
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

738 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