I’ve got a big query that queries one post_type
with all different kinds of filters. Values are taken from <form>
inputs.
- Im adding 3 different checkboxes to the
<form>
which can
be used aspost_type
toggle – this means that you can query only onepost_type
of the three, two of them or all at once - Every
post_type
has it’s own inputs that I show / hide with jQuery post_type
inputs should only affect / filter its ownpost_type
- All the results must be displayed in same list
My question is: how to query different post_types
when each have its own arguments?
Thoughts after few days of thinking about this:
-
Three different queries (poor, poor performance) and compile multiple queries into one loop?
-
While Im having tons of query arguments, it should drastically speed up query because there’s pretty narrow scope, at least my logic says it and three different queries shouldn’t be that bad even if each have thousands of posts?
-
My only concern is that user can also query without filling any inputs which means that all three queries are quering ALL the posts.
-
-
Including several
post_types
seems impossible – you cannot use differentmetas
andtaxes
on differentpost_types
using conditional logic in same query, right?