The code below gets the image but I want it to be a background image. I believe I need to save the image as a variable first and then echo it out somehow. My PHP is not great so please give an example using the code. No esoteric answers, thanks.
<div class="main-slider" class="flexslider">
<ul class="slides">
<?php
// Get all posts in 'slider' category
$post_categories = wp_get_post_categories( $post_id );
$args = array(
'post_type' => array( 'Interaction', 'Print', 'Motion', 'Image', 'Sound' ),
'numberposts' => 6,
'category_name' => 'slider'
);
$postQuery = get_posts( $args );
foreach( $postQuery as $post ) :
setup_postdata($post);
if ( has_post_thumbnail() ) { ?>
<li class="frontSlider"><?php the_post_thumbnail('feature-slider'); ?>
<a href="<?php echo get_permalink(); ?>" title="Go to <?php echo the_title(); ?>" rel="bookmark">
<div class="flex-captionWrap">
<p class="flex-caption"><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p><!-- Retrieves text string from Captions field in Media -->
</div>
</a>
</li>
<?php
}
endforeach; ?>
</ul><!-- .flexslider -->
</div><!-- .flexslider -->