Problems with Loop Wordpress

1

I am creating the Category.php page and using a Custom Post Type named Father . Within this post type has some categories: 1, 2, 3, 4 etc. What I wanted was that by going to the category 4 page, I would only show the posts of this category, but it is showing all posts from this < in> Post Type .

The loop I'm using is this:

$args = array(
    'post_type' => 'pai',
); 

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

<p>Existe Posts</p>

endwhile;

else:

<p>Não Existe Posts...</p>

endif;
wp_reset_postdata();
    
asked by anonymous 05.09.2018 / 13:05

0 answers