Utilisez ce code pour pouvoir afficher l’ensemble des autres mots clés associés aux articles visibles dans une page de tag

[pastacode lang= »php » message= »Afficher les autres mots-clés associés aux articles visibles » highlight= » » provider= »manual » manual= »%3C%3Fphp%0A%2F%2FOn%20d%C3%A9clare%20l%E2%80%99array%20qui%20va%20contenir%20les%20mots-cl%C3%A9s%0A%24tags%20%3D%20array()%3B%0A%2F%2FD%C3%A9claration%20et%20d%C3%A9but%20de%20la%20boucle%0Aif%20(%20have_posts()%20)%20%3A%20while%20(%20have_posts()%20)%20%3A%20the_post()%3B%0A%2F%2F%C3%89tape%201%2C%20on%20r%C3%A9cup%C3%A8re%20les%20infos%0A%24posttags%20%3D%20get_the_tags(%24post-%3EID)%3B%0Aif%20(%24posttags)%7B%0Aforeach%20(%24posttags%20as%20%24posttag)%7B%0A%24tags%5B%24posttag-%3Eterm_id%5D%20%3D%20%24posttag-%3Ename%3B%7D%7D%3F%3E%0A%2F%2FPLACEZ%20ICI%20LE%20LOOP%20DE%20VOTRE%20THEME%0A%3C%3Fphp%20%2F%2FFin%20de%20la%20boucle%0Aendwhile%3B%0A%2F%2F%C3%89tape%202%2C%20on%20filtre%20et%20on%20affiche%0A%2F%2FOn%20supprime%20le%20mot-cl%C3%A9%20sur%20lequel%20on%20se%20trouve%20d%C3%A9j%C3%A0%0A%24currenttag%20%3D%20array(single_tag_title( »%2C%20false))%3B%0A%24tags%3Darray_diff(%24tags%2C%24currenttag)%3B%0A%2F%2FOn%20affiche%20les%20mots-cl%C3%A9s%20associ%C3%A9s%20aux%20autres%20articles%20d%C3%A9j%C3%A0%20pr%C3%A9sents%0Aif%20(%24tags)%7B%0Aecho%20’%3Ch2%3ERetrouvez%20les%20autres%20th%C3%A8mes%20associ%C3%A9s%20%C3%A0%20ces%20articles%3C%2Fh2%3E%3Cul%3E’%3B%0Aforeach%20(%20%24tags%20as%20%24k%20)%20%7B%0A%24tag%20%3D%20get_term_by(‘name’%2C%24k%2C%20’post_tag’)%3B%0A%24permalink%20%3D%20get_permalink(%20%24tag-%3Eterm_id%20)%3B%0Aecho%20’%3Cli%3E%3Ca%20href%3D%22′.%24permalink.’%22%20title%3D%22Les%20articles%20sur%20′.%24k.’%22%3E’.%24k%0A.’%3C%2Fa%3E%3C%2Fli%3E’%3B%7D%0Aecho%20’%3C%2Ful%3E’%3B%7D%0Aendif%3B%0A%3F%3E »/]