pmdci on "Can I pass a query to a custom post type using a custom taxonomy?"
May 29, 2010 by David Olsen
@anointed
Thank you for the feedback mate!
Well at the moment I am using /partners/?city=rome or /hotels/?city=rome and I can live with it.
I do have a question you might help me out with…
say I have three custom post types, which I use page templates for them:
* Car – using page-cars.php for this post type
* Hotel – using page-hotels.php for this post type
* Partner – using page-partners.php for this post type
So far, if browse to:
/partners or /hotels or /partners, it shows the correct page, each page querying the correct post type.
However, if I browse to /<post-type-name> (that is, the taxonomy name) rather than the custom page I created for them, WordPress redirects to the custom page that queries the post type. For example:
/partner/ -> redirects to /partners/
/car/ -> redirects to /cars/
However, for ONE POST TYPE ONLY (say, hotel), it DOES NOT WORK:
/partner/ -> redirects to / (that is, the root directory).
I am quite puzzled, since I there is almost no difference in these post types configuration (rewrite, query, etc).
Moreover, the query code in the custom pages for these post types is pretty much the same, only that the post_type name changes. What really changes in these pages is some of the HTML and CSS.
Any ideas of what might be wrong?
Cheers,
P.





Comments
Facebook comments:
Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!