Title: wekko's Replies | WordPress.org

---

# wekko

  [  ](https://wordpress.org/support/users/wekko/)

 *   [Profile](https://wordpress.org/support/users/wekko/)
 *   [Topics Started](https://wordpress.org/support/users/wekko/topics/)
 *   [Replies Created](https://wordpress.org/support/users/wekko/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/wekko/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/wekko/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/wekko/engagements/)
 *   [Favorites](https://wordpress.org/support/users/wekko/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Blogroll split into 2 columns?](https://wordpress.org/support/topic/blogroll-split-into-2-columns/)
 *  [wekko](https://wordpress.org/support/users/wekko/)
 * (@wekko)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/blogroll-split-into-2-columns/#post-1353863)
 * livelearncreate’s solution is nice, but I changed it a bit. I wanted the link
   categories to be shown too. Also, I didn’t want to split up the categories. That
   means not every column will have the same height (except when they have the same
   amount of links) but that was not a big of a deal for me. If you still want that
   you should combine mine and livelearncreate’s code.
 *     ```
       <?php
                   $nrOfColumns = 5;
   
                   $terms = get_terms('link_category', 'orderby=name') ;
   
                   $rowsPerColumn = round(count($terms)/$nrOfColumns);
   
                   for($i = 0; $i<$nrOfColumns; $i++) {
                       echo '<div class="column" id="column-' . $i . '">';
                       for($j = ($i * $rowsPerColumn); $j<($rowsPerColumn * ($i+1)); $j++) {
                           if(!isset($terms[$j]))
                               continue;
   
                           $bookmarks = get_bookmarks('category=' . $terms[$j]->term_id);
                           ?>
                           <h2><?php echo $terms[$j]->name; ?></h2>
                           <ul>
                               <?php
                               foreach($bookmarks as $bookmark) {
                                   echo '<li><a href="' . $bookmark->link_url . '">' . $bookmark->link_name . '</a></li>';
                               }
                               ?>
                           </ul>
                           <?php
                       }
                       echo '</div>';
                   }
                ?>
       ```
   
 * The corresponding CSS:
 *     ```
       #footer div.footer-menu .column { float: left; width: 170px; margin-right: 10px; }
           #footer div.footer-menu .column ul { padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px dotted #ccc; }
         #footer div.footer-menu h2 { font-size: 10pt; color: #fff; margin: 0; font-weight: bold; }
       ```
   
 * You can change the number of columns by changing the $nrOfColumns variable to
   a different number. Also note the column width and margin width in the first 
   line of the CSS.
 * [Frank](http://frankherrman.nl)

Viewing 1 replies (of 1 total)