WordPress.org

Forums

[resolved] Repeated Link Category Display in Sidebar (2 posts)

  1. jatucker
    Member
    Posted 8 years ago #

    I've been using WordPress precisely two days, so in addition to being very impressed, I must admit that I'm barely literate at all, so any help is so welcome. Also, I'm guessing that this has been answer before but after 2 hours of searching, I've finally decided to post it.

    I'm using the Theme Solitude, and it offers this sidebar code for category links.

    ' <?php
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    foreach ($link_cats as $link_cat) {
    ?>
    <h4>Some Repeated Text</h4>

      <?php wp_get_links($link_cat->cat_id); ?>

    <?php } ?>'

    Because I've created 6 different link categories, each with an ID number, this displays as

    Some Repeated Text
    Some Repeated Text
    Some Repeated Text
    - link (where I've assigned a link to a category)
    Some Repeated Text

    and so on.

    I would like the link categories to display with the text of the link category, and the links under each as they are assigned.

    Possible?

  2. jatucker
    Member
    Posted 8 years ago #

    Ok, this is solved. I took out that entire code and replaced it with a simple rule


    <h4><?php get_links_list('id'); ?></h4>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags