Tag page
-
Hi, i wanna make a page with 4 collumns with an overview of my tags
i find a blog here and there is an example of code but i do not become the 4 columns, i have a long list of tags but not in 4 columns.
i have made a template-page in my theme but can somebody help me where to do something to become the 4 columns?here is the code where i´m wrestling with…
<?php // Make an array from A to Z. $characters = range('a','z'); // Check if $characters exists and ensure that it is an array. if( $characters && is_array( $characters ) ) { foreach( $characters as $index=>$character ) { // Get the tag information for each characters in the array. $tags = get_tags( array('name__like' => $character, 'order' => 'ASC') ); // Output a wrapper so that our arrays will be contained in 4 columns. if ($index != 0 && $index % 4 == 0) { $html = "<div class='post-tags clearfix' style='clear:left;'>"; } else { $html = "<div class='post-tags clearfix'>"; } // Output the character and use it as the title. $html .= "<h3 class='title'>{$character}</h3>"; // Output the markup for each tag found for each character. if ($tags) { $html .= "<ul>"; foreach ( (array) $tags as $tag ) { $tag_link = get_tag_link($tag->term_id); $html .= "<li class='tag-item'>"; if ( $tag->count > 1 ) { $html .= "<p><a href='{$tag_link}' title='View all {$tag->count} articles with the tag of {$tag->name}' class='{$tag->slug}'>"; } else { $html .= "<p><a href='{$tag_link}' title='View the article tagged {$tag->name}' class='{$tag->slug}'>"; } $html .= "{$tag->name}</a><span>#{$tag->count}</span></p>"; $html .= "</li>"; } $html .= '</ul>'; } $html .= '</div>'; // Output the markup for the current character. echo $html; // Increment the index by 1. $index++; } } ?>help will be appriciated
The topic ‘Tag page’ is closed to new replies.