Hey guys im using css background image to resize and center the wordpress featured image however im strugling to get this to dispaly using PHP.
The code im tyring to get to work is as follows, as you can see im thing to inline style within the loop. However this is not displaying any results.
<div class="outer">
<section class="post">
<div class="postTop">
<div class="postLeft">
<div style="background-image:url(<?php if ( has_post_thumbnail() ) { the_post_thumbnail() } ?>)" id="postBox">
</div>
</div>
<div class="postRight">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div>
</div>
<div class="postBottom">
<date><?php the_date(); ?></date>
<a href="<?php comments_link(); ?>">
<?php
printf( _nx( 'One Comment', '%1$s Comments', get_comments_number(), 'comments title', 'textdomain' ), number_format_i18n( get_comments_number() ) ); ?>
</a>
<div class="readmore"><a href="<?php the_permalink(); ?>">Read More</a></div>
</div>
</section>
</div>
</div>