Advertisement
Guest User

Untitled

a guest
Apr 26th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <aside id="more_from" class="span2">
  2.  
  3. Some projects from <br />
  4. <?php
  5. $service_type = (get_the_term_list( $post->ID, 'service' ));
  6. ?>
  7. <span class="btn btn-info btn_white_text btn-mini"><?php echo $service_type; ?></span><br />
  8.  
  9. <!-- pull other items in the current section -->
  10.  
  11. <?php
  12. $t_args = array (
  13. 'tax_query' => array (
  14. array (
  15. 'orderby' => 'rand',
  16. 'post_type' => 'portfolio',
  17. 'taxonomy' => 'service',
  18. 'field' => 'slug',
  19. 'terms' => $service_type,
  20. 'post__not_in' => array($post->ID)
  21. )
  22. )
  23. );
  24.  
  25. $query = new WP_Query( $t_args );
  26.  
  27. if( $query->have_posts() ) {
  28. while ( $query->have_posts() ) : $query->the_post();
  29.  
  30. // output your stuff
  31. echo '<div class="more_from_thumb"><a href="';
  32. the_permalink();
  33. echo '">';
  34. the_post_thumbnail('tiny_thumb');
  35. echo '</a></div>';
  36. endwhile;
  37. wp_reset_query();
  38. } ?>
  39. </aside> <!--#more_from-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement