Custom taxonomy help
-
I have created a custom taxonomy called ‘type’ that is all working perfectly, but I am trying to create on the single pages a list of all the posts in whatever taxonomy the single post is in. For example, if I have a post called ‘My Cat’ and it is under the ‘type’ => ‘kittens’ , I want to show content from all the other posts in kittens automatically. I know i can do this by adding a if or statement at the end of the single.php for every taxonomy, but I want a way that it will just query the posts automatically based on whatever taxonomy the single post is in.
Here is what I have been trying to do:
RATHER THAN THIS which is too specific and won’t work automatically if I add a new taxonomy<?php query_posts( array( ‘type’ => ‘kittens’ , ‘order’ => ‘ASC’, ‘showposts’ =>-1 )); ?>
I want to do something like this:
<?php query_posts( array( ‘type’ => $term->slug , ‘order’ => ‘ASC’, ‘showposts’ =>-1 )); ?>
but I can’t get it to work. I think it should be easy, but I need helpz.Thanks!!
The topic ‘Custom taxonomy help’ is closed to new replies.