Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

Thanks!

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

1 Answer 1

<?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

 
discard

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.