I created a custom post type called, "Portfolio," using a plugin called Custom Post Type UI v0.7.1. I have created several categories for it, such as Logos, Packaging, etc.
I need to use archive.php to filter by category.
Right now I have an archive-portfolio.php
that includes this code:
<?php $wp_query = null; $wp_query = $temp;?>
<?php $temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query(); ?>
<?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&showposts=20'); ?>
<ul>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
echo '<li><a href="'; the_permalink(); echo '">';
echo '<strong>'; the_title();
echo '</strong>';
echo '</a></li>';
?>
<?php endwhile; ?>
</ul>
I've tried using URLs like /?category_name=logos
and /?cat=logos
but none of that has worked; it just displays all portfolio items regardless of category.
The Portfolio custom post type has "Archive" and "Hierarchical" enabled.
For built-in taxonomies, it has categories and tags enabled as well.
Any ideas?