List links by category name not ID
-
Hi everyone,
I’ve justed started using the Tiga theme but I can’t figure out how to list my links by category name and not ID.
The current code looks like this:
<?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
}
}
?>Any ideas about what I should change it to? I did look at the codex but I didn’t understand it!!
Thanks, Jo
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘List links by category name not ID’ is closed to new replies.