@wownewmedia & @alanchrishughes:
I had the same problem. The WP_query()
or query_posts()
just spitted out all the posts from my custom post type Factory, ignoring my custom taxonomy selection.
It started to work after I changed "rewrite" => true
in register_taxonomy()
to:
register_taxonomy("factoryType", array("factory"), array("hierarchical" => true, "label" => "Factory Types", "singular_label" => "Factory Type", "rewrite" => array("slug" => "factorytype")));
in my template file:
<?php
$args=array(
'factorytype' => 'small-factory',
'post_type' => 'factory',
'posts_per_page' => 10,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>