Support » Fixing WordPress » Link list with multiple categories and classes

  • Resolved dan121


    I’m trying display my links list like this, with multiple link categories mixed together, showing the most recently updated first and with the link category as a class:

    <li class="cat1"><a href="">Link 1</a></li>
    <li class="cat2"><a href="">Link 2</a></li>
    <li class="cat2"><a href="">Link 3</a></li>
    <li class="cat4"><a href="">Link 4</a></li>
    <li class="cat3"><a href="">Link 5</a></li>

    Is there any way to do this? This would get me close, but I have no idea how to add the category to the class:

    <?php get_links('-1', '<li class=>', '</li>', '', FALSE, '_id', FALSE,
    FALSE, 5, FALSE); ?>

    I’ve also tried this (using the Link Manager to define the category class values), but the foreach ends up grouping them by category:

    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    foreach ($link_cats as $link_cat) {
    } ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Link list with multiple categories and classes’ is closed to new replies.