Support » Fixing WordPress » Links madness in sidebar…

  • I cannot figure out what the problem is with this theme that we are developing. It’s uploaded at and it behaves EXACTLY THE WAY IT SHOULD.

    But for some reason, it won’t display correctly on our own testbed site. .. if it’s not the default theme you see (it should be), you should be able to select it from the Change Themes sidebar area. )

    I am clueless as to why it’s misbehaving. It appears that for just the Links/Blogroll section, it’s NOT honoring the H2 Title tag and I cannot understand this, since it’s fine at the site.

    Any ideas? The sidebar code relevant to the links section only is below:

    from sidebar.php:

    // links
    $cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    $catcount = 0;
    foreach( $cats as $cat )
    $catcount += count( $cat );
    if ( $catcount > 0 )
    sp_sidebar_open( "links", "<h2>Links</h2>" );
    echo '<ul>';
    foreach( $cats as $cat )
    echo "<li><div class=sidebar-heading><h2>$cat->cat_name</h2></div><div class=sidebar-content><ul>";
    get_links( $cat->cat_id, '<li>','</li>','', false, 'name', false, false, -1, false, true );
    echo "</ul></div>";
    echo '</ul>';
    sp_sidebar_close( );
    } // count > 0

    I tried hardcoding the required code but that made no difference, and besides, that code is included in the functions.php file (and all the other sidebar sections have no problem displaying it properly):

    from functions.php:

    // opens a sidebar with the id as $id and the header text as $head (<h2>/</h2> are not automatic)
    function sp_sidebar_open( $id='', $head='' )
    global $_sp_sidebar_is_open;
    if ($_sp_sidebar_is_open)
    $_sp_sidebar_is_open = true;
    if ($id !== '')
    $id = " id="$id"";
    echo "<li$id><div class=sidebar-head>$head</div><div class=sidebar-content>";

    In the source code at our testbed site, it looks like it’s just ignoring the [h2]Title[/h2] completely and not bothering to display it. Is there some code I need to place inside the () area of get_links to make it display this?

    Thanks for any help. Maybe I’m just too tired from working with this all day. 🙂

Viewing 1 replies (of 1 total)
  • I would have checked the “Resolved” box above but I just found the reason for the bad behavior of the Links/Blogroll sidebar section.. On my testbed site, widgets were enabeled. When I turned them off, it was fine.

    I still need help discovering how to fix it so that it does render as intended with widgets turned on as all the cool kiddies seem to want them.

    Thanks all.

Viewing 1 replies (of 1 total)
  • The topic ‘Links madness in sidebar…’ is closed to new replies.