0
votes

I create a custom post type called Portfolio, and a custom taxonomy called project-type. There are several categories in the taxonomy including Featured. I'm trying to query only the Portfolio posts that have the Featured category. The category id is 35.

I can get the posts from the custom post type to appear, but I cannot figure out how to only display that single category. Here is what I have:

<?php query_posts('post_type=portfolio&posts_per_page=4&cat=35'); ?>

That code above doesn't display any portfolio posts. Any ideas on how I can get it to just display category 35?

1

1 Answers

0
votes

You can try this code.

 <?php 
    global $query_string;
    if (is_category('35')) : 
    $posts = query_posts( $query_string . '&post_type=portfolio&posts_per_page=4&cat=35' ); 
    else : 
    endif; 
    ?>