How can I access the variable for the author of a post in PHP?
-
I have a blog with various authors.
I want to be able to identify which author wrote the post by variable so that I can display their photo beside the post.
I can display the author using the following:
<p>Written by: <?php the_author_posts_link(); ?></p>
but i would like to be able to say: “if user1, display user1.jpg” etc..
I tried the following with no success:
$curauth = (string)the_author_posts_link(); if($curauth=="Jim Balmer") { echo "<img src=\"images/jim.jpg\">"; }
THANKS FOR YOUR TIME! ??
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How can I access the variable for the author of a post in PHP?’ is closed to new replies.