New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'include_children' parameter to tax queries #120

Closed
billerickson opened this Issue Jul 13, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@billerickson
Owner

billerickson commented Jul 13, 2016

When doing a tax_query, include_children defaults to true, so any content in categories that are children of the one you specify are included. Setting this to false lets you only receive content in that specific category.

See WP_Query Codex for a listing of tax_query parameters. See this issue on .org requesting this feature.

@billerickson

This comment has been minimized.

Show comment
Hide comment
@billerickson

billerickson Aug 1, 2016

Owner

Example:

[display-posts taxonomy="category" tax_term="cars" tax_include_children="false"] Will display all the posts that are in the "cars" category, but will not include posts that are only in subcategories of "cars".

Owner

billerickson commented Aug 1, 2016

Example:

[display-posts taxonomy="category" tax_term="cars" tax_include_children="false"] Will display all the posts that are in the "cars" category, but will not include posts that are only in subcategories of "cars".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment