I am using custom post type plugin and I am trying to loop only selected post for a particular category within my custom post. I would like to loop only selected category. Any suggestion?
Here is my code :
<?php
$loop=new WP_Query(array(
'post_type'=>'custom post';
'taxonomy '->'private';
'sort_column' => 'post_date',
'posts_per_page'=> -1 ,
'order' => 'ASC')
);
if ( $loop->have_posts() ){?>
<?php
while ( $loop->have_posts() )
{
$loop->the_post();
$meta=get_post_meta(get_the_id(),'');
?>
Use tax query of wordpress inside the wp_query
and replace the
'terms' => 'bob',
with'terms' => '<your category slug>',
Slug can be checked from back-endAccording to the wp_query docs
use it like this: