function tisse_la_toile_tag_request() { // get all posts and tags as json $return = array(); $tags = wp_get_all_tags(); foreach ($tags as $tag) { $args = array('tag' => $tag->name, 'showposts' => 500, 'ignore_sticky_posts' => 1); $my_query = new WP_Query($args); if ($my_query->have_posts()) { $return[] = array("source" => "Histoire du Web", "target" => $tag->name, "type" => "tag"); while ($my_query->have_posts()) { $my_query->the_post(); $return[] = array("source" => $tag->name, "target" => get_the_title(), "type" => "article", 'url' => get_permalink()); } } } wp_reset_query(); echo json_encode($return); die; }
if(d.url){ //console.log(d.url); window.open(d.url); } } }); </script> <div class="wrap"> <h2 style="text-transform:uppercase;line-height:1;margin:3em 0;padding-left:100px"><span class="byline" style="display:block;font-size:60%;">Taxonomie</span> mots-clefs</h2> <?php $tags = wp_get_all_tags(); if (count($tags) < 0) { ?> <p>Aucun fil tissé pour l'instant... Reviens plus tard.</p> <?php } else { ?> <dl class="items-list"> <?php $current_header = ''; foreach ($tags as $tag) { // get all posts by that tag $args = array('tag' => $tag->name, 'showposts' => 500, 'ignore_sticky_posts' => 1); $my_query = new WP_Query($args); if ($my_query->have_posts()) { $first_letter = strtoupper(substr($tag->name, 0, 1));