1. Home
  2. Business & Finance
  3. Real Estate Business

The Single Post Page PHP Code Modification to Show Author Link

By , About.com Guide

Again, if you don't have a pressing need to do this now, don't mess with it.
Adding Code to Add Author Link to Posts

Adding PHP code to Add Author Site Link to Posts

Jim Kimmons
In the Design Themes area, we can edit our theme pages. Each page type has the code here. I am wanting to modify the page that displays a single post, so I select the single.php page to add a small piece of code. Where did I find this little code snippet? That's the great thing about WordPress. There are tens of thousands of users and developers out there to help us. The WordPress site gives us all of the "template tags" for items used in our blog. But that's not the full code to get it to insert properly. I did a Google Search on "template tag code to add author site link" and got this page with that code and more.

YOUR REALLY HAVE TO BE CAREFUL DOING CODE MODS! First, do a right click and select all of the text in this page code box. Copy it and paste it into a temporary WordPad or NotePad file. If you blow up your page, you can simply replace all the code with the original without trying to undo whatever you did.

Now, I just replaced the code that was in this little display box with my new code that you see highlighted in yellow. How did I find this spot? You get used to recognizing text without having to know PHP. Notice that it's near the top of the post page, and that it began by showing "Posted in" and then the word category. That's what was right in front of the original author "by:" entry that didn't link to anything. I just replaced that next item with the new code, saved the page and checked the result.

Don't do this kind of thing unless you just can't find a plugin to do the job for you. One thing that this will definitely effect is if you change themes later. You'll lose this change, as the new theme's coding will replace it. Just remember what you've done in case you need to re-do it again in a new theme. Perhaps copy out that code to a WordPad file and save it.

  1. Home
  2. Business & Finance
  3. Real Estate Business
  4. Marketing for Real Estate
  5. Internet Marketing
  6. WordPress User and Author Setup and Link>

©2009 About.com, a part of The New York Times Company.

All rights reserved.