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
940 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
  • 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn how to dynamically set the form action using jQuery.

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now