Support

Account

Home Forums General Issues WP_Query with taxonomy field

Helping

WP_Query with taxonomy field

    • TheJema

    • December 2, 2019 at 6:37 am

    Hi friends!
    I’m using ACF, great plugin!
    I have a question:
    My site posts have several field. Screenshot: https://prnt.sc/q4pue1
    2 fields have a choice of taxonomy, multiple choice
    How to write a WP_Query request so that the selection would be for posts that that have selected taxonomies?

    • TheJema

    • December 2, 2019 at 9:28 am

    This not forking

    $args = [
    		'posts_per_page' => - 1,
    		'meta_query'     => [
    			'relation' => 'AND',
    			[
    				'key'     => 'cities_start1',
    				'value'   => [4,11,34],
    				'compare' => 'IN',
    			],
    			[
    				'key'     => 'cities_finish2',
    				'value'   => [3,12],
    				'compare' => 'IN',
    			],
    		]
    	];
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.