Links madness in sidebar…
-
I cannot figure out what the problem is with this theme that we are developing. It’s uploaded at https://themes.wordpress.net and it behaves EXACTLY THE WAY IT SHOULD.
But for some reason, it won’t display correctly on our own testbed site.
https://wpthemes.mytestbed.com .. 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 themes.wordpress.net site.
https://themes.wordpress.net/columns/2-columns/1439/business-theme-3-risk/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 > 0I 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)
return;
$_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. ??
- The topic ‘Links madness in sidebar…’ is closed to new replies.