Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <aside id="more_from" class="span2">
- Some projects from <br />
- <?php
- $service_types = $term_list = get_the_terms( $post->ID, 'service');
- if(!is_wp_error( $service_types ) && $service_types) :
- foreach($service_types as $service_type) :
- ?>
- <span class="btn btn-info btn_white_text btn-mini"><?php echo $service_type->name; ?></span><br />
- <!-- pull other items in the current section -->
- <?php
- $t_args = array (
- 'orderby' => 'rand',
- 'post_type' => 'portfolio',
- 'posts_per_page' => 5,
- 'post__not_in' => array($post->ID),
- 'tax_query' => array(
- array(
- 'taxonomy' => 'service',
- 'field' => 'id',
- 'terms' => $service_type->term_id
- )
- )
- );
- $query = new WP_Query( $t_args );
- if( $query->have_posts() ) {
- while ( $query->have_posts() ) : $query->the_post();
- // output your stuff
- echo '<div class="more_from_thumb"><a href="';
- the_permalink();
- echo '">';
- //the_post_thumbnail('tiny_thumb');
- the_title();
- echo '</a></div>';
- endwhile;
- wp_reset_postdata();
- } ?>
- </aside> <!--#more_from-->
- <?php endforeach; ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement