Thoughts of JS » Search Results for "word press the_author_link"
Link your username to your web site or blog (WordPress)
As you already know, the author of a post can be displayed by using this Template Tag. This tag must be used within The Loop. WordPress recommends the following usage: This post was written by <?php the_author(); ?> The result will be: This post was written by someguy Some of the guys are using: <?php the_author_link(); ?> The 1st one will display the username, nothing else. The 2nd one will add link to the users posts list. None of these is what I needed. I wanted to have it like this: This article was written by Joseph Szenasi on xxx. Here is the code I came up with: This article was posted by <?php if (get_the_author() == 'Joseph') { echo '<a href="http://www.josephszenasi.com" target="_blank">Joseph Szenasi</a>'; } else { echo get_the_author(); } ?> on <?php the_time(__('F jS, Y', 'default')) ?>. Replace Joseph with your username and my website’s URL with yours. Contact me if you need help. Good luck! Incoming search … Read entire article »
Filed under: Web development