Pour faire une sélection d’articles dans une liste d’articles (page d’accueil, de catégorie, de mots clés…). Modifiez le loop ainsi :

[pastacode lang= »php » message= » » highlight= » » provider= »manual » manual= »%3C%3Fphp%0A%2F%2FMa%20boucle%20pour%20afficher%20des%20articles%20mis%20en%20avant%0Awhile%20(%24query-%3Ehave_posts())%20%3A%20%24query-%3Ethe_post()%3B%0A%2F%2FOn%20stocke%20dans%20%24do_not_duplicate%20les%20articles%20%C3%A0%20ne%20pas%20afficher%20plus%20tard%0A%24do_not_duplicate%5B%5D%20%3D%20%24post-%3EID%3B%0A%2F%2F%20Le%20contenu%20de%20ma%20premi%C3%A8re%20boucle%20est%20plac%C3%A9%20ici%0Aendwhile%3B%0A%3F%3E%0A%3C%3Fphp%0A%2F%2FMa%20boucle%20pour%20afficher%20les%20articles%20habituels%0Aif%20(%20have_posts()%20)%20%3A%20while%20(%20have_posts()%20)%20%3A%20the_post()%3B%0A%2F%2FOn%20n%E2%80%99affiche%20pas%20les%20articles%20d%C3%A9j%C3%A0%20affich%C3%A9s%0Aif%20(in_array(%24post-%3EID%2C%20%24do_not_duplicate))%20continue%3B%0A%2F%2FLOOP%0A%E2%80%A6″/]