Custom Post Type & Taxonomy?

Hi, I’m working on some Custom Post Types and they are coming along very well :). But of course everything can’t go smooth, and I have now hit a bump in the road.

My question now is;

How do I show a post from one specific taxonomy from a Custom Post Type in such as the footer.php?

This is maybe not explained very well, so I shall try to explain it clearer for you.

Let’s say I have made a Custom Post Type with the name Quote and a Taxonomy with the name Genre (Taxonomy = ‘hierarchical’ => true, this make it behave like a category). Inside Genre I make two “categories”; One with the name New and the other with the name Old. Like this:

Quote

  • Genre
    New
    Old

This works beautiful on the page, but it’s when I try to get the newest post from each of these “categories” to show in my footer.php that things don’t work anymore.

I have done almost exactly this before and it have worked grate, but then I used the regular Categories, this was the code used then:

<?php query_posts(‘category_name=stallnytt&showposts=1’); ?>

So how do I get my newest post from the taxonomy Genre; New and Old?

This is maybe as easy as categories but I can’t figure this one out and would really appreciate it if someone could help me with this :).

I hope I have explained what I’m after clearly enough, my English (writing) is sadly not the best. (:

I think you need add post type in the query string. try this

<?php query_posts($query_string . ‘post_type=Quote’); ?>

or check this link for the same solutions

Thanks for answering :slight_smile:

  1. Which link are you talking about? :slight_smile:
  2. This works, but it doesn’t do what I want, now I just get the latest post from my Custom Post Type; Quote, but what I wanted was to show one post from the taxonomy; Genre (category) New and one from Old, so how do I go about to get that outcome?

It seems you want to query multiple categories, i dont have solutions for this at present. but meanwhile check this plugin
http://wordpress.org/extend/plugins/query-multiple-taxonomies/ may suits your req.

Thanks