File: /home/www/wp-content/themes/qizhou/single-ot_portfolio.php
<?php
/**
*显示所有投资组合的模板
*
*默认情况下,这是显示所有投资组合的模板。
*请注意,这是WordPress构建的作品集
*你的WordPress网站上的其他“投资组合”可能会使用
*不同的模板。
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Makaffo
*/
get_header();
?>
<?php
while ( have_posts() ) : the_post();
the_content();
endwhile; // End of the loop.
?>
<?php if( makaffo_get_option('pf_nav') || makaffo_get_option('pf_social_share_switch') ) { ?>
<div class="container">
<div class="project-bottom">
<?php if( makaffo_get_option('pf_nav') ) { ?>
<div class="single-project-navigation">
<?php makaffo_single_post_nav(); ?>
</div>
<?php } ?>
<?php if( makaffo_get_option('pf_related_switch') ) { ?>
<div class="project-related-posts-wrap">
<div class="project-related-title-wrap">
<h3 class="project-related-title"><?php echo makaffo_get_option('pf_related_text'); ?></h3>
</div>
<div class="project-related-posts ot-slider ot-project-slider style-1" <?php if( is_rtl() ){ echo'dir="rtl"'; }?>>
<div class="owl-carousel owl-theme">
<?php
// get the custom post type's taxonomy terms
$custom_taxterms = wp_get_object_terms( $post->ID, 'portfolio_cat', array('fields' => 'ids') );
// arguments
$args = array(
'post_type' => 'ot_portfolio',
'post_status' => 'publish',
'posts_per_page' => 30, // you may edit this number
'ignore_sticky_posts' => 1,
'orderby' => 'rand',
'tax_query' => array(
array(
'taxonomy' => 'portfolio_cat',
'field' => 'id',
'terms' => $custom_taxterms
)
),
'post__not_in' => array ($post->ID),
);
$second_query = new WP_Query( $args );
//Loop through posts and display...
if($second_query->have_posts()) : while ($second_query->have_posts() ) : $second_query->the_post();
/*
*为内容包含特定于帖子类型的模板。
*如果要在子主题中覆盖此内容,请包含一个文件
*称为content-__.php(其中__是Post Type名称),将使用它。
*/
get_template_part( 'template-parts/content', 'project-filter' );
endwhile; wp_reset_query(); endif;
?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<?php
get_footer();