I've been all over Codex looking for a code sample to do what I want, which is to read the post tags and, if the tag slug is equal to something, do a different format and continue processing the loop.
Once I got the format to work with the basic code that read the tag slug, I began crafting code for circumstances where there would be more than one tag, as is often the case. That is when my joy ended. :)
I have an image with my comments here:
http://mildlymystified.com/toomanytags/too-many-fav-images.png
Here is the code that is producing top half of image, without the comments, of course. The problem is in the foreach loop, I believe.
<div class="thumbnail">
<a href="<?php the_permalink(); ?>">
<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
<span class="overlay"></span>
</a>
<div class="category"><?php the_category(); ?></div>
<span class="month"><?php echo get_post_meta( $post->ID, '_ct_text_4e3318cbab83d', true ); ?>
<?php foreach (get_the_tags('slug') as $tag) {
if ($tag = 'fav') { ?>
<span class="fav"><img src="<?php bloginfo(url)?>/wp-content/themes/TheStyle/images/fav-icon.png" /></span>
<?php } elseif (!($tag = 'fav')) { ?>
<span class="fav"><img src="<?php bloginfo(url)?>/wp-content/themes/TheStyle/images/no-fav-icon.png" /></span>
<?php }; ?>
</span><!--</span>-->
<?php }; ?>
</div> <!-- end .thumbnail -->
Ultimately, the goal is to not have an image if the tag slug is not equal to "fav." If ANYONE has any insights as to how I can tweak this code to accomplish this, it would be most helpful!
Thanks in advance.