Can't list posts by custom terms
-
I have searched for so long before posting.
I have created a custom post-type “products” and there are few “product-category” likes books, electronics and games.
I can list all products in archive-products.php. Then, I created a “taxonomy-product-category.php” template to show the posts after clicking on the “get_term_link()” of a specific product category.
But now all the three pages below shows the same list of posts of ALL products but not corresponding product category:
http://mydomain.com/product-category/books/
http://mydomain.com/product-category/electronics/
http://mydomain.com/product-category/games/I guess there is something wrong with the WP_Query in the taxonomy-product-category.php:
<?php $new_query = new WP_Query(); $new_query->query('post_type=products'); ?> <?php while ($new_query->have_posts()) : $new_query->the_post(); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php endwhile; ?>Please kindly help~~
The topic ‘Can't list posts by custom terms’ is closed to new replies.