Custom post type category returns null

Question

I created a CPT with CPT UI and register a taxonomy for my CPT.

I get all of this post type

<?php 

$args = array(
'post_type' => 'market',
'post_status' => 'publish',
'posts_per_page' => -1    );              

$the_query = new WP_Query( $args );
if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : 
$the_query->the_post(); 
?>      

everything works fine but <?php the_category(', '); ?> returns null.

where is the problem?

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/custom-post-type-category-returns-null/">

Custom post type category returns null</a>
0
, Sina Maafi 3 months 0 Answers 28 views 0

Leave an answer