Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Visiting

mysite.com/?taxonomy_name=slug,

or otherwise querying for a taxonomy, lists both matching posts and pages. (My taxonomy applies to both posts and pages.) I would prefer that it listed only the posts. I don't think earlier version of wordpress worked this way.

Am I doing something wrong? Is there a proper way to get just the posts? I can think of hacks to fix it such as modifying the archive template or query hooks, but is there a simpler way? Can this behavior be changed in the way you register your taxonomy?

share|improve this question
add comment

1 Answer 1

I think you were trying to use

mysite.com/tag/tag_slug  

ie damien.co/tag/wordpress

You can try to use ?s= (search) and ?t= (tag) as URL parameters

share|improve this answer
    
Well, my question is not about the specific URL or query syntax that you use. It is just about the output. tag/tag_slug isn't a good example because tags only apply to posts and never to pages. But yes in your syntax tax/tax_slug is what I'm asking about. If the tax applies to posts and pages, is it always true that both will show up in this query? –  sam Jul 13 '12 at 23:00
    
hi again - categories and tags by default are not assigned to pages. if they were added, then this is part of your theme customisation and the theme author would have decided to include page-tags (same applies to adding tags or categories to custom post formats). hope that helps? Damien –  Damien Jul 13 '12 at 23:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.