Query the author
-
Hi everyone,
I have a bit of code in my template that displays a picture if one has been asigned and displays another if it hasn’t. I want to change this code to display a picture if the author is “cescabell” and display another if it isn’t
I have tried looking through the codex, but can’t quite figure it out. Can anyone help?
The code is
<td valign = top><span> <?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?> <!-- DISPLAYS THE IMAGE URL SPECIFIED IN THE CUSTOM FIELD --> <img src="<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>" alt="" class="th" height="150" width="150"/><BR CLEAR=ALL> <?php } else { ?> <!-- DISPLAY THE DEFAULT IMAGE, IF CUSTOM FIELD HAS NOT BEEN COMPLETED --> <img src="<?php bloginfo('template_directory'); ?>/images/no-img-thumb.jpg" alt="" class="th" height="100" width="100"/><BR CLEAR=ALL> <?php } ?></span> </td>
Many thanks,
You can see how the current code works on the front page of my site: https://www.outsidecontext.com
Thanks for reading!
Basho
- The topic ‘Query the author’ is closed to new replies.