Support » Plugin: Query Wrangler » Create single query for custom post type & display by tax term manually?

  • Resolved macmike78

    (@macmike78)


    I’m not sure if I’m even wording this right – let me try to explain what I’m trying to do here…

    I have a custom post type with 10 categories. I created a new query for the custom post type. Under filters I have my post type selected. Now, I didn’t select my taxonomy under filters because I’m wondering if I can reuse my the same CPT query shortcode on 10 different pages and include an argument within each to display the posts with a particular taxonomy term on each of the 10 pages?

    Right now I have 10 querys set up and it works great but am thinking I can probably pull this off with a single query shortcode & arguments but can’t quite wrap my head around it.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Hi Macmike,

    You can do use arguments in the shortcodes to change some filters, but the very complex filters that require arrays won’t work. Core tags and category arguments will work, because they have simple arguments in the WP_Query class.

    Example using core categories: [query slug="my-query" args="category_name=my-category-slug"]

    Hope this helps, let me know if it is unclear.
    Jonathan

    Thanks so much @daggerhart! Got it!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create single query for custom post type & display by tax term manually?’ is closed to new replies.