Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on "[Plugin: Polylang] Setting post language via custom post form"

$
0
0

You can't mix a string with an array. But you can query both languages at the same time:

$posts = get_posts(array(
	'post_type'    => 'post',
	'tax_query'   => array(
		'relation' => 'OR',
		array(
			'taxonomy' => 'language',
			'terms'    => get_terms('language', array('fields'=>'ids')),
			'operator' => 'NOT IN'
		),
		array(
			'taxonomy' => 'language',
			'field'    => 'slug',
			'terms'    => array('en', 'sr')
		)
	)
));

Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>