Underwater photography by Andy Kirkland

Link organisation with the Category Overload plugin

I’m also looking after my Club’s site, and have loaded Alex King’s CategoryOverload plugin.
This is cool, as it lets you build a hierarchy of link categories.

I’ve written a custom SQL routine – which I’ve included in one of our pages – to use this for output, by cycling through the different sub-categories of a parent (other links aren’t output).
This works with WordPress 2.1.3.
Feel free to adapt it.

Here’s the skeleton code, for a “parent” category with an ID of 12.
Note that Php commands have an extra space inserted after the “< " to prevent accidental execution. This first bit builds a array of sub-categories :- [code lang="php"] get_results($querystr, OBJECT); ?> [/code]

… Then this part loops through each subcategory and outputs it.
(you may want to put some formatting in …)

[code lang=”php”]
< ?php if ($linkcats): ?>
< ?php foreach ($linkcats as $linkcat): ?>
< ?php echo $linkcat->cat_name ; ?>
< ?php get_links( $linkcat->cat_id, ”, ”, ”, TRUE, ‘category’, TRUE, FALSE, -1, FALSE, TRUE); ?>
< ?php endforeach; ?>
< ?php endif; ?>

The URI to TrackBack this entry is: https://muttznutz.net/muttzblog/site-news/link-organisation-with-the-categoryoverload-plugin/trackback

RSS feed for comments on this post.

Valid XHTML 1.0 Strict