Free Wordpress Blog Setup

How to Organize Your WordPress Blogroll Links?

By Editorial Staff in Tutorials
How to Organize Your WordPress Blogroll Links?

Many WordPress Themes that are released usually come with the default blogroll codes. With that code you have no control over the organization of the blogroll links in your sidebar. By default it is all organized alphabetically, but in this article we will show you how you can control how your blogroll is displayed.

The default code looks like the one below:

<?php wp_list_bookmarks(); ?>

The code above will show all links and categorizes them alphabetically. First it will organize the categories you place the links in, and then it will organize the links within the categories. But what if you just want to display a specific category of links.

First you need to make a category in your Links section of the WordPress Admin Panel. Then add links to it. Once you have done that find out the category id.

<?php wp_list_bookmarks('title_li=&category=2'); ?>

Change the number 2 to the category id, and you can now sort out your links at different areas of the template if you so desire. Now you can take the code above to the next step where you can add more parameters to actually organize the way links are organized.

There is a parameter called “Orderby” which gives the following options:

  • ‘id’
  • ‘url’
  • ‘name’
  • ‘target’
  • ‘description’
  • ‘owner’ – User who added bookmark through bookmarks Manager.
  • ‘rating’
  • ‘updated’
  • ‘rel’ – bookmark relationship (XFN).
  • ‘notes’
  • ‘rss’
  • ‘length’ – The length of the bookmark name, shortest to longest.
  • ‘rand’ – Display bookmarks in random order.

So now your code will look like:

<?php wp_list_bookmarks('title_li=&category=2&orderby=id'); ?>

In the above code you are telling WordPress to pull links from category 2, arrange them in list format, and to display them in the order which comes first. So link id=1 will be shown first. WordPress by default shows ascending. But you can change the order by making the following changes:

<?php wp_list_bookmarks('title_li=&category=2&orderby=id&order=DESC'); ?>

Now you are telling WordPress to show the links in the descending order. There are multiple other ways you can organize your blogroll links in WordPress. Please refer to the WordPress Codex for more instructions.

What Next?

Digg it
Save This Page
Subscribe to WPBeginner
Stumble it
Free Wordpress Blog Setup

Comments

3 Responses to “How to Organize Your WordPress Blogroll Links?”
  1. Aaron says:

    How do you get the link description to show up with the link?

  2. allen says:

    how do you make it so the category name can be formmated properly. my wordpress theme somehow adds an tag around the category name and it is HUMONGOUS next to the links that are below it.

    please does anyone know how to reduce the size of the category name? I am using WordPress Gear theme.

Share Your Opinions

Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!

Please make sure that you have read our Comment Policy.

Due to high volume of request from our readers, we are adding this feature that allows you to stay updated with this post's comments without having to participate in the discussion even though we would love your input as always. Don't worry we hate SPAM just as much as you do, so you will never receive any SPAM messages from our site and that's our promise to you.

Subscribe without commenting

Close Bar