Un utilisateur a demandé 👇
Salut,
Pourriez-vous m’aider à changer cette simple question ? have_posts()) { $query->the_post();
?> `
afficher uniquement les messages d’un “type” de taxonomie personnalisé et son terme “exemple 1”
Merci beaucoup
(@subrataemfluence)
il y a 2 ans, 4 mois
Cela devrait fonctionner :
<?php
$args = array(
'post_type' => 'your_post_type', // if you want to further filter by post_type
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'term_id',
'terms' => 37 // you need to know the term_id of your term "example 1"
)
)
);
$query = new WP_Query( $args ); ?>
while ( query->have_posts() ):
$query->the_post();
...
endwhile;
Faites-moi savoir si cela aide!
Cela a-t-il résolu votre problème ?
Was this helpful?
0 / 0