File "related-portfolio.php"
Full Path: /home/flipjqml/onlinebetsolution.com/wp-content/themes/xion-progression/template-parts/related-portfolio.php
File size: 1.47 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* @package pro
*/
?>
<?php $terms = get_the_terms( $post->ID , 'portfolio-category' ); if ( !empty( $terms ) ) :?>
<?php
global $post;
$current_post_type = get_post_type( $post );
$terms = get_the_terms( $post->ID , 'portfolio-category' );
$term_ids = array_values( wp_list_pluck( $terms,'term_id' ) );
$args=array(
'post_type' => $current_post_type,
'posts_per_page'=> '3', // Number of related posts that will be displayed.
'orderby'=>'rand', // Randomize the posts
'post__not_in' => array( $post->ID ),
'tax_query' => array(
array(
'taxonomy' => 'portfolio-category',
'terms' => $term_ids,
'field' => 'id',
'operator' => 'IN'
)
),
);
$rel_query = new WP_Query( $args ); if( $rel_query->have_posts() ) :
?>
<div id="progression-related-posts-section">
<h3 id="more-related-posts-heading"><?php esc_html_e( 'MORE RELEASES', 'xion-progression' ); ?></h3>
<ul class="progression-studios-related-index-list">
<?php while ( $rel_query->have_posts() ) : $rel_query->the_post(); ?>
<li class="related-liste-progression-studios"><?php get_template_part( 'template-parts/content', 'portfolio'); ?></li>
<?php endwhile; ?>
</ul><!-- close .progression-studios-related-index-list -->
<div class="clearfix-pro"></div>
</div><!-- close #progression-related-posts-section -->
<?php endif; wp_reset_postdata(); ?>
<?php endif; ?>
<div class="clearfix-pro"></div>