How to Display 2 Lists of Links Near Each Other

In this tutorial we will be achieving two lists of links next to each other, as shown in the image:

links

First of all log into your WordPress wp-admin section, go to Links > Link Categories and create two new categories called Col1 and Col2.

Insert a few links under each category.

Next open up your template and in the place where you want the two columns to appear, enter the following code:

<h3>Links</h3>  /* style the h3 as you wish */

<ul>
<?php wp_list_bookmarks('category_name=col1&title_li=0&categorize=0'); ?>
</ul>

<ul class="col2>
<?php wp_list_bookmarks('category_name=col2&title_li=0&categorize=0'); ?>
</ul>

As you can see the important parameters are category_name (set to either col1 or col2), title_li and categorize (set to 0 because I don’t want the category names to be shown).

In your CSS remember to set ul to float:left and set a width according to the style you want to achieve. I am using the col2 class to achieve a 20px left margin on the 2nd column.

Hope you find this useful.

Related posts:

  1. WordPress Archive by Category
  2. How to Check if Post Is in a Descendent Category
  3. Filter for Excluding Certain Categories in WordPress
  4. Using CSS to Generate Footnote Links for Printing
  5. Enhancing WordPress’ wP_list_pages With Page Lists Plus

Leave a Comment

Let us know your thoughts on this post but remember to place nicely folks!