Custom post type and new wp query for category page (1 post)

  1. jumust
    Posted 4 years ago #

    I created a custom template for a category (and children) called cat_mycatname.php

    Here I want to query posts only from a custom post type and with a tag

    // The Query
    $cat_id = get_cat_ID();
      'cat' => $cat_id,
      'post_type' => 'videopagine',
      'tag' => 'space',
    $the_query = new WP_Query( $args );
    while ( $the_query->have_posts() ) : $the_query->the_post();

    It can't seem to filter my results as I normally would, it just displays all the entries in that custom post type (in both parent and children cat pages)
    What's wrong?

Topic Closed

This topic has been closed to new replies.

About this Topic