YMC-22 / smart-filter

YMC Smart Filter, allows to solve a variety of tasks for displaying posts on site pages. For advanced developers, there is an opportunity to independently develop layouts for filters and post cards, which makes the plugin universal.
14 stars 6 forks source link

Advanced query with multiple categories selected in query options #38

Closed jjkommunikation closed 1 month ago

jjkommunikation commented 1 month ago

Hi,

i have an issue with doing an advanced query in my filter,

i want to do a date sort from an acf field on each selected category filter im trying to do this in advanced query with following: post_type=events&posts_per_page=-1&meta_key=start_dato&orderby=meta_value_num&order=ASC&tax_query[0][taxonomy]=category&tax_query[0][field]=term_id&tax_query[0][terms]=7,9&tax_query[0][operator]=IN

but its doing this sort on every selected category in my frontend, i have also tried to do a "pre_get_posts" actions, maybe im overlooking something

ymc_filter_and_grids_advanced_query

YMC-22 commented 1 month ago

Hi! You can use the query generator - https://crocoblock.com/freemium/tools/wp-query-generator/ Or we recommend you use another advanced query method - https://prnt.sc/UGsG9EEfls1P There you will need to specify the required parameters of the ACF fields for the WP Query object.