mathieubeauregard
3/7/2018 - 5:29 PM

Get post

Wordpress function example, for quick arguments reference. With WPML, "suppress_filters" ensures posts are in current language.

$posts = get_posts(array(
	'post_type' => array('post_type'),
	'post_status' => array('publish'),
	'order' => 'ASC',
	'orderby' => 'menu_order',
	'posts_per_page' => -1,
	'suppress_filters' => 0,
	'tax_query' => array(
		array(
			'taxonomy' => $term->taxonomy,
			'field' => 'term_id',
			'terms' => array($term->term_id)
		),
	),
	'meta_query' => array(
		'relation' => 'OR',
		array(
			'key'=> 'web_tba',
			'value' => true,
			'compare' => 'LIKE',
		),
		array(
			'key' => 'web_date',
			'value' => $yesterday,
			'compare' => '>',
		),
	)
));