Turn on author_posts_link if author has posts
-
I’d like to make it so on a PAGE that I can have an image link that links to the author’s post page to go to https://thesite.com/author/joe but only if the author has posts…
If have looked at the forums and found this code and it appears to be close to what I need…
‘<?php $desc = get_the_author_description();
if ($desc!=”) { // The description is not empty
echo ‘<i>Posted by: ‘;
the_author_posts_link();
echo ‘</i>’;
}
else {
echo ‘<i>Posted by: ‘;
<?php the_author_nickname(); ?>
echo ‘</i>’
}
?>’and I am trying to write it so that if there are posts, then an image will display on the page that links to the author’s post page..
so if the author has posts, then display…
<img src=”/images/my_img.jpg” width=”200″ height=”40″ border=”0″>
but if the author does not ahve posts, then display nothing…
Can anyone shed some light on this for me?
Thanks!
- The topic ‘Turn on author_posts_link if author has posts’ is closed to new replies.