CPT category post/content is not showing on my page, Please review my coede

<?php
$args = array(
//’posts_per_page’ => 99,
‘post_type’ => ‘course’,
‘category_name’ => ‘Consectetur adipiscing elit sed do eiusmod’, //<– custom post type category name, I have used it to find its content
‘orderby’ => ‘date’,
//’order’ => ‘ASC’,
‘ignore_sticky_posts’ => 1,
‘paged’ => $paged);
$loop = new WP_Query($args);
if ($loop->have_posts()) :
while ($loop->have_posts()) : $loop->the_post();
the_title(sprintf(‘<li><a href=”%s” rel=”bookmark”>’,
esc_url(get_permalink())), ‘</a></li>’);
endwhile;
endif;
wp_reset_postdata();
?>

I have tried this with default post type “post” without category name its working. But woth CPT, custom post type and custom taxonomy its not working.

Read more here:: CPT category post/content is not showing on my page, Please review my coede

Leave a Reply

Your email address will not be published. Required fields are marked *