Querys Wordpress - fundar/Curul501 GitHub Wiki

Busqueda por custom post type y custom field

$args = array('post_type' => 'representante',
	'meta_query' => array(
		array (
			'key'	  => 'wp_commissions',
			'value'   => 'Transparencia y Anticorrupción',
			'compare' => 'LIKE' 
		)
	)
);

$loop = new WP_Query($args);
$num  = $loop->post_count;
die(var_dump($num));