arthur-eudeline
1/19/2018 - 10:21 AM

WordPress requête de flux personnalisé

WordPress requête de flux personnalisé

<?php

//Custom post query
query_posts(array(
	'post_type' => array('[ Post Type Slug ]'),
	'tax_query' => array(
		'relation' => 'AND', array(
		    'taxonomy' => '[ custom taxonomy slug ]',
		    'field' => 'slug',
		    'terms' => array( '[ value to looking for ]' )
	)),
));

// The Loop
while ( have_posts() ) : the_post();
  ?>
       
       <!-- CODE HTML DE LA BOUCLE -->
       <p class="col-xs-6"><?php the_title(); ?></p>

<?php
endwhile;

// Reset Query
wp_reset_query();

?>