Masthead
One of my photos

Specific cry for help

March 10th, 2007 · Posted by Skuds in Technology · No Comments · Technology

Are there any WordPress/php gurus out there who can suggest a way to get this bit of code working under WP 2.1.2?

<?php
$link_cats = $wpdb->get_results(“SELECT cat_id, cat_name FROM $wpdb->linkcategories”);

foreach ($link_cats as $link_cat) {
if (get_links($link_cat->cat_id, ”, ”, ”, FALSE, ”, FALSE, FALSE, -1, FALSE, FALSE)) {
?>
<div class=”left-widget-title”
id=”linkcat-<?php echo $link_cat->cat_id; ?>”>
<?php echo $link_cat->cat_name; ?>
</div>
<div class=”left-widget”>
<ul>
<?php wp_get_links($link_cat->cat_id); ?>
</ul>
</div>
<?php
}
}
?>

I have replaced it with:

<div class=”left-widget-title”>Links</div>
<div class=”left-widget”>
<?php wp_list_bookmarks(‘title_after=&title_before=’); ?>
</div>

To actually get links in the sidebar instead of error codes, but it doesn’t look good. The left-widget-title class is what gives me section headings in the sidebar. The old code used to put each category of links in a section heading (blogroll, places, books) and worked very well before.

It is something to do with how the database has changed structure with different table names and everything so that old commands like wp_get_links() don’t necessarily work the same way. I think.

I’m a bit reluctant to go changing themes just yet – even to upgrade to the new version of this Tiga theme as I would have to spend ages doing all the customisation again.

Tags: ·

No Comments so far ↓

Like the collective mind of the Daily Mail, comments are closed.