• Hello i have this code that display 3 Column of tags, but i want to display 4 column but i don´t know how.
    Anybody can help me, i am a newbie in wordpress and Php
    Thanks

    <?php
    $tags = get_tags( array('name__like' => "a", 'order' => 'ASC') );
    $tags_count = count($tags);
    $count = intval( $tags->count );
    $percolumn = ceil($tags_count / 3);
    
    for ($i = 0;$i < $tags_count;$i++):
        if ($i < $percolumn):
        $tag_left .= '
    	<li><a href="'. get_tag_link($tags[$i]->term_id) . '"rel="tag">' . $tags[$i]->name .' (' . $tags[$i]->count . ')</a></li>
    ' . "\n";
        elseif ($i >= $percolumn && $i < $percolumn*2):
        $tag_mid .= '
    	<li><a href="'. get_tag_link($tags[$i]->term_id) . '"rel="tag">' . $tags[$i]->name .'  (' . $tags[$i]->count . ')</a></li>
    ' . "\n";
        elseif ($i >= $percolumn*2):
        $tag_right .= '
    	<li><a href="'. get_tag_link($tags[$i]->term_id) . '"rel="tag">' . $tags[$i]->name .' (' . $tags[$i]->count . ')</a></li>
    ' . "\n";
        endif;
    endfor;
    ?>
    
    <div class="list">
    <ul>
    <?php echo $tag_left; ?>
    </ul>
    </div>
    
    <div class="listlist">
    <ul>
    <?php echo $tag_mid; ?>
    </ul>
    </div>
    
    <div class="list">
    <ul>
    <?php echo $tag_right; ?>
    </ul>
    </div>

  • The topic ‘Display tag in 4 column’ is closed to new replies.