Advertisement
chandlerswatch

Styling a Post Thumbnail

Oct 20th, 2011
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <div class="griditemleft">
  2. <?php
  3. $my_query = new WP_Query( 'posts_per_page=9&cat=6' );
  4. ?>
  5. <?php if ( $my_query->have_posts() ) {
  6. while ( $my_query->have_posts() ) {
  7. $my_query->the_post();
  8. echo get_the_post_thumbnail($id, 'thumbnail', array('class' => 'alignleft {margin-left: 30px; display: block;}', 'alt' => 'alttext'));
  9. }
  10. }
  11. ?>
  12. <?php
  13. wp_reset_postdata();
  14. ?>
  15. </div>
  16.  
  17. Here is the css for griditemleft:
  18. .griditemleft{
  19. float: left;
  20. width: 600px;
  21. margin: 10px 40px 40px 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement