tags:

views:

279

answers:

1

Hello!

I've been fiddling around with Wordpress and I've realised that the links and link categories provide very little functionality.

For example, I want to display all the links in a certain link category in one page, and not any of the other links. And in the remaining pages I want to display every link except those that have said category.

I can think of a dumb way of doing it, using a simple "Text Widget" and doing the list in HTML, but I was wondering if there was a smarter way. Like a way of being able to select which link categories I want displayed on a "Links" widget. A way to have several such widgets would also be great to divide the links among more than one sidebar.

Thanks in advance.

A: 

You can filter links based on the link category, so if you had a category foo you could get all links that were inside foo by using.

<?php wp_list_bookmarks('title_li=&categorize=0&category_name=foo' ); ?>

Foo can also be a varible, so you could figure out which page you were on and filter you list based on the title. In this case if I were on a post or page called bar the output would be all the links in the bar category.

<?php wp_list_bookmarks('title_li=&categorize=0&category_name='.$post->post_title ); ?>

Tom
So, that means I can't use the provided "Links" widget and have to use "Text" widgets and drop the PHP in there? Or create my own widget?
Farinha
I'm not sure about widgets, but it's fairly straightforward to modify the actual template files.
Tom