adding a photo to blog posts unique to each author
-
What I’m trying to do is display the author name with a photo of the author next to their respective blog entries.
The following code is in the loop. I’m pretty green with PHP, so I may not be approaching this from the best angle. I have bolded the code that I wrote (the rest if from the wordpress support documentation).
<?php if(get_query_var('author_name')) : $curauth = get_userdatabylogin(get_query_var('author_name')); else : $curauth = get_userdata(get_query_var('author')); endif; if($curauth=="chimpact") { echo "<img src=\"images/cheryl-125x125.jpg\">"; } ?> <p>Written by: <?php the_author_posts_link(); ?></p>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘adding a photo to blog posts unique to each author’ is closed to new replies.