Advertisement
jedifunk

post_thumbnail url custom loop

Apr 21st, 2011
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.     $args = array( 'post_type' => 'work' );
  3.     $go = new WP_Query( $args );
  4.     while ( $go->have_posts() ) : $go->the_post();
  5. ?>
  6. <?php
  7.     $imgID = get_post_thumbnail_id();
  8.     $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
  9. ?>
  10. <article class="work">
  11.     <a class="group" rel="fancybox" href="<?php echo $url; ?>" >
  12.         <div class="work-thumb">
  13.             <?php the_post_thumbnail(); ?>
  14.         </div>
  15.         <h4 class="work-info work-title">
  16.             <?php the_title(); ?>
  17.         </h4>
  18.         <div class="work-info work-content">
  19.             <?php the_content(); ?>
  20.         </div>
  21.     </a>
  22. </article>
  23. <?php endwhile; wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement