Customizing your links.php page

As promised a couple weeks ago, here is a little explanation of how to customize your wordpress links.php template file. (I would recommend a bit of wordpress & html knowledge).

Many of you may have experimented with the links manager in the backend, but hit the same problem that I did. That issue being around the line break between the link name and it’s description.

Basically, the problem is whatever you put in the form box “Between Link and Description:” in your backend is completely ignored by the standard links.php template file.

It’s all to do with the get_links_list function. This function is used on the links.php page in the default wordpress template theme. Now i’m not a php developer, I only read about this on a wordpress support post, so sue me if i’m wrong.

Open up your links.php template file in any html editor and replace the get_links_list with wp_get_links(‘1’)

What you are doing is calling your link categories individually, instead of all together. ‘1’ being your first link category you created (e.g. “Blogroll”). Now there are probably easier ways, using pre-built plugins, to accomplish this, but doing it my way allows for a certain amount of flexibility in the styling of each link category.

Wrapping a simple div structure around your function and referring it to a class in your css stylesheet can make it look however you want it to.

For example, in my template design I wrote something like this in my links.php page:

Customizing your wordpress links template page

And added this to my CSS stylesheet:

Customizing your wordpress links template page

Upload your edited links.php and your css stylesheet page, make sure you have “description” checked in your links manager, and hopefully, voila!


4 responses

  1. Thanks Mark!
    Most useful… I’m trying to customize my site at the moment into something new and this will be very helpful.

  2. I’m about to create my own little links page so I appreciate it.

  3. Very good tutorial. Having the CSS styles as images was a bit of a pain, a class tag and some css applied to that would allow you to put the direct text in there making copy / paste a little easier, but not a big thing.

    You or other readers might also want to check out the plug-in iMP Links which does a very similar thing with ‘out-of-the’zip’ functionality. It’s default CSS is quite reasonable. I’m in the midst of a major re-design of my site, http://www.oastler.caLinks Page.


  4. Jamie: Thanks for the link mate. iMP Links looks a very cool plugin that I am defintely going to download and have a play with.

    My apologies for the CSS styles as images, I’m a lazy bastard and should have rather used the code tags in the wordpress backend. Next time I promise.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.