How to add a custom term into the cycle WP_Query in Wordpress?

Hello, help to solve the problem. Why not add therm (about) in the WP_Query loop?
The output is working, checked

5def73bab7cd6426499629.png

Here is the source code :

<?php
if (!defined('ABSPATH')) {
die();
}
?> 

<?php

$term = WP_Term::get_instance( '21', 'rubrika' );

 $loop = new WP_Query($term);

 print_r( $term );

 if ($loop->have_posts()) :

?> 

<!-- Testimonials -->
<div class="content-container lg">
 <div class="row">
 <div class="col-sm-9">
 <h2>Notes From the CEO</h2>

 <!-- Swiper Testimonials -->
 <div class="swiper-swiper slider-testimonials">
 <!-- Swiper Wrapper -->
 <div class="swiper-wrapper">
 <?php while ($loop->have_posts()) : $loop->the_post(); ?>
 <div class="swiper-slide">
 <blockquote class="blockquote">
 <div class="margin-b-20">
 <?php the_field('feedback_text', get_the_ID(), true); ?>
</div>
 <div class="margin-b-20">
 Lorem ipsum dolor sit amet consectetur adipiscing elit sed tempor incididunt tempor incididunt ut laboret dolore magna aliqua consequat minim siad.
</div>
 <p><span class="fweight-700 color-link">Joh Milner</span>, Metronic Customer</p>
</blockquote>
</div>

<?php
endwhile;
wp_reset_query();
?>
</div>
 <!-- End Swiper Wrapper -->

 <!-- Pagination -->
 <div class="swiper-testimonials-pagination"></div>
</div>
 <!-- End Swiper Testimonials -->
</div>
</div>
 <!--// end row -->
</div>
<!-- End Testimonials -->
<?php endif; ?>


And function.php just in case :
feedback_post_type function(){
 register_post_type('feedback', array(
 'labels' => array(
 'name' => 'Reviews', // the name of the record type
 'singular_name' => 'Feedback', // separate name entries of type Book
),
 'public' => true, 
 'has_archive' => true,
 'menu_position' => 50,
 'supports' => array('title','editor','author','thumbnail','excerpt','comments')
 ) 
);

register_taxonomy(
'rubrika',
'feedback',
array(
 'label' => __( 'Category' ),
 'public' => true,
 'rewrite' => false,
 'hierarchical' => true,
)
);


}
 add_action('init', 'feedback_post_type');
April 3rd 20 at 17:17
0 answer

Find more questions by tags WordPress