How can I include this (or something similar)
<?php if ( get_post_meta($post->ID, 'url', true) ) { ?>
<a href="<?php echo get_post_meta($post->ID, "url", $single = true); ?>"><?php the_post_thumbnail('');?></a>
<?php } else { ?>
<?php the_post_thumbnail('');?>
<?php } ?>
Into this simple widget query?
query_posts('post_type=sponsors&meta_key=_vof_sponsor_level&meta_value=Gold');
if (have_posts()) :
echo "<div class='imageshadow sponsorwidgetslides'>";
while (have_posts()) : the_post();
the_post_thumbnail('sponsorwidget');
endwhile;
echo "</div><!--/.imageshadow-->";
echo "<a class='widgetlink' href='";
bloginfo('url');
echo "/sponsors'>View all Sponsors »</a>";
endif;
wp_reset_query();
So basically, if the custom field "url" exists it outputs the featured image wrapped in an anchor tag, but if the custom field doesn't exist it just outputs the featured image.
Also, I know it's not ideal using query_posts, and that get_posts would be better, but I'm under orders here.