WordPress.org

Support

Link Category

  • I am trying to add a new link category to my sidebar, however when i do this, the link heading is the same for all categories, ie

    I want something like

    Travel Links
    -Link 1
    -Link 2

    News Links
    -Link 1
    -Link 2

    However I am getting

    Travel Links
    -Link 1
    -Link 2

    Travel Links
    -Link 1
    -Link 2

    The script i am using is as follows:

    <!– start links –>
    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>

    <?php
    $link_cats = $wpdb->get_results(“SELECT cat_id, cat_name FROM $wpdb->linkcategories”);
    foreach ($link_cats as $link_cat) {
    ?>
    <h3>Travel Links</h3>

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

    <?php } ?>

    <!– end links –>

    Can someone tell me the correct script i need, btw the site is

    http://www.roylloydjones.com

    if I havent explained it very clearly

Viewing 7 replies - 1 through 7 (of 7 total)
  • ok i’ve done it dont worry

    For the benefit of the next person who reads this … please post your solution ??

    good idea

    changed my script to

    <!-- start links -->
    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?><br />
    <?php<br />
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");<br />
    foreach ($link_cats as $link_cat) {<br />
    ?><br />
    <li id="linkcat-<?php echo $link_cat->cat_id; ?>"><h3><?php echo $link_cat->cat_name; ?></h3>
    <ul>
    <?php wp_get_links($link_cat->cat_id); ?>
    </ul>
    </li>
    <?php } ?>

    <!-- end links -->

    my only problem now is i have a bullet point before the Link Category name which I cant get rid of…..any suggestions???

    and this page has gone funny

    You have borked the forum. Please go back in and edit yopur post urgently.

    finally! full screen!!! 😆 ^_^

    its great!!
    i change this script to

    <!-- start links -->

    <?php<br />
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");<br />
    foreach ($link_cats as $link_cat) {?><br />
    <br><id="linkcat-<?php echo $link_cat->cat_id; ?>"><h3><?php echo $link_cat->cat_name; ?></h3>
    <?php wp_get_links($link_cat->cat_id); ?>

    <?php } ?>

    <!-- end links -->

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Link Category’ is closed to new replies.
Skip to toolbar