Site icon Hip-Hop Website Design and Development

get different meta-data of a complicated query at the same time

I have a function that generate a very complicated query with meta_query, tax_query etc.
and now am using it in a filter page.

i need to fill the filter page by some meta data, like number of paied, and free articles.
Note: the paied and free articles might be uniqe for each user, it depends on the users plan

if you ever work with laravel, you will just call withCount twice in the same query, to get the paid and free posts count

and now i only see two solutions for this task, either call the query 3 times, 1 to get posts, and one to get the free article counts, one to get the paid article counts, or create raw sql query manually, and this will be so painfull for a complicated query.

is there any good solution for this in WP?