Family Encyclopedia >> Electronics

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, everything is organized alphabetically, but in this article we'll show you how you can control how your blogroll is displayed.

Update:Please note that the Link Manager was removed in WordPress 3.5. We recommend that you use WordPress menus because they are much more flexible. See details in this article..

The default code looks like below:

The above code will display all the links and sort them alphabetically. You will first organize the categories you put the links into, and then organize the links within the categories. But what if you only want to display a specific category of links?

You must first create a category in your Links section of the WordPress Admin Panel. Then add links to it. Once you've done that, find the category id.

Change the number 2 to the category id, and now you can arrange your links in different areas of the template, if you like. You can now take the code above to the next step, where you can add more parameters to really organize the way the links are organized.

There is a parameter called "Orderby" that gives the following options:

  • 'identity card'
  • 'url'
  • 'name'
  • 'target'
  • 'description'
  • 'owner':user who added the bookmark via the bookmark manager.
  • 'classification'
  • 'updated'
  • 'rel' - marker relation (XFN).
  • 'notes'
  • 'rss'
  • 'length':the length of the bookmark name, from shortest to longest.
  • 'rand' - Show markers in random order.

So now your code will look like:

In the code above, you're telling WordPress to pull the links out of category 2, arrange them in a list format, and display them in the order that they come first. So link id =1 will be displayed first. WordPress by default is shown ascending. But you can change the order by making the following changes:

You are now telling WordPress to display the links in descending order. There are many other ways you can organize your blogroll links in WordPress. Please see the WordPress Codex for further instructions.