under construction, as ever :)

WP links -> blogroll

May 12th, 2007 Posted in blogging

Since one of my WordPress upgrades this year i have been missing some functionality that was there before:

  • my links to other people’s blogs didn’t behave as before: my one-category display-use was broken and i was missing the option to limit the number of links displayed per category and randomize them.
  • my WYSIWYG-like editor for writing posts doesn’t work anymore; i have to type the (X)HTML myself

I haven’t actively searched for a solution because it didn’t really bother me much, the second one even only affects my interaction with the blog engine. However, yesterday i came across the cause of the first issue: in WP 2.1 and newer the get_links_list() function is replaced by wp_list_bookmarks(). Another change is that ‘blogroll’ categories are now the same as post-categories, and all their category-IDs have been changed in the transition.

The old piece of code in my Sidebar file was get_links_list(). This displayed all link categories according to limit & ordering settings you could choose in your admin interface. It was also possible to display only one category, by giving the category ID as argument. I used that to put only the Blogs-category in my frontpage sidebar, and a different category in the sidebar for the About page.

To get the first behaviour in WP 2.1 and up you can use the following: wp_list_bookmarks('orderby=rand&limit=5');.
If you want to display only one category simply add one argument: wp_list_bookmarks('category=7&orderby=rand&limit=5');. Remember to lookup the ID for the category you want to display: you can find these among the ‘regular’ categories under Manage, Categories. You can also select multiple categories here by simply putting comma’s in between.

I must say i’m a bit ambivalent in my opinion about these changes. If you don’t mind fiddling with the PHP of your theme these changes are probably for the better: it has become a lot easier to customize your link display with this new function and its arguments. A downside is that it is harder to keep track of which categories are for posts and which for links. Luckily i was already using all-lowercase names for post categories and my blogroll categories start with uppercase letters, but i’m not sure i agree that users should be bothered with making this distinction obvious for themselves. Another big downside is that you can no longer manage how your blogroll-links (odd namechange btw, i use my links for more than only a blogroll) are displayed from the admin interface.

What i missed most in this transition was an ‘IMPORTANT! CHECK THE FOLLOWING:’-warning in the upgrade howto on the WordPress site, at least regarding the changed category IDs. There’s still room for improvement in the WordPress documentation-department :) Oh and if anyone has a clue how i can get back my WYSIWYG-editor, please let me know! :D

Post a Comment