Question

Any suggestions on the simplest way to display tags using get_tags in an html table (4 columns across) ?

Example:
Tag 1 | Tag2 | Tag 3 | Tag 4
Tag 5 | Tag 6 | Tag 7 | Tag 8

I'm using the following code to display tags, I found it in codex.:

    $tags = get_tags();
$html = '<div class="post_tags">';
foreach ($tags as $tag){
    $tag_link = get_tag_link($tag->term_id);

    $html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
    $html .= "{$tag->name}</a>";
}
$html .= '</div>';
echo $html;

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top