Skip to content

Instantly share code, notes, and snippets.

@jesseschmidt
Created May 31, 2013 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseschmidt/5688689 to your computer and use it in GitHub Desktop.
Save jesseschmidt/5688689 to your computer and use it in GitHub Desktop.
Show different thumbnail for posts that are not tagged with tradeshow.
<?php
$recent = new WP_Query("cat=11&showposts=2"); while($recent->have_posts()) : $recent->the_post();
if ( has_tag( 'tradeshow' ) ) {
echo '<a href="http://demo.com/your_image.jpg">Link Title</a>';
} else {
echo '<a href="' . the_permalink() . '">' . get_the_post_thumbnail() . '</a>';
}
endwhile;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment