WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to control the alignment of the featured image(the thumbnail) with the options given in the 'Set featured image' pop box.

<?php if(has_post_thumbnail()) {
   echo '<div class="border">'; the_post_thumbnail(); echo '</div>';
} ?>

I want to add to the div with the class of border a class floatleft or floatright(or nothing) according for what the user chooses.


share|improve this question
Why add the unnecessary div? The img is a block. It has classes. Style the border around it directly. – Otto Jun 23 '12 at 1:45
because its a double border, you can see here: fanboy.co.il/works/debundle – Ron Kantor Jun 26 '12 at 21:02
<?php echo get_the_post_thumbnail($id, 'thumbnail', array('class' => 'alignleft')); ?>

see codex for more

share|improve this answer
i need to add the alignleft call to div with the border class. and the align needs to be a var. – Ron Kantor Jun 26 '12 at 21:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.