Support » Fixing WordPress » Links in Tiga Theme

  • What do I need to change in the following code for my links, which are now listed under Blogroll, to show up correctly?
    <!-- Begin - Links from the 'Links Manager'-->
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    foreach ($link_cats as $link_cat) {
    if (get_links($link_cat->cat_id, '', '', '', FALSE, '', FALSE, FALSE, -1, FALSE, FALSE)) {
    <div class="left-widget-title"
    id="linkcat-<?php echo $link_cat->cat_id; ?>">
    <?php echo $link_cat->cat_name; ?>
    <div class="left-widget">
    <?php wp_get_links($link_cat->cat_id); ?>
    <!-- End - Links from the 'Links Manager'-->

    With the above code, I get the following error:
    [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1]
    SELECT cat_id, cat_name FROM

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thanks for starting this topic. I’ve got the same problem. So far, all other areas of my site (with tiga theme) are fine after upgrading, but the links in my sidebar aren’t showing up.

    Change the part of the theme to this:
    <div class=”bookmarks”>
    <?php wp_list_bookmarks(); ?>

    Then add CSS to styles.php to alter the contents. I used this, although some of it is overkill, but I don’t have time to tweak it:

    .bookmarks {
    border-color:<?php tiga_widgetBorderColor(LEFT); ?>;
    width:<?php tiga_leftWidgetWidth(); ?>px;
    border-width:1px 1px 1px 1px;
    padding:0px 5px 5px 5px;
    margin-top: 0px;
    .bookmarks h2{
    <?php tiga_bgImage(‘leftWidgetTitle’); ?>
    <?php tiga_bgImage(‘leftWidgetTitle’); ?>
    border-color:<?php tiga_widgetBorderColor(LEFT); ?>;
    color:<?php tiga_widgetTitleFontColor(LEFT); ?>;
    background-color:<?php tiga_widgetTitleBgColor(LEFT); ?>;
    border-width:0px 0px 1px 0px;
    font-weight: bold;
    margin:-0px -5px 5px;
    .bookmarks li{
    list-style: none;
    .bookmarks ul{

    If anyone has better CSS or a better idea, please send email to me:

    That breaks my page and only the left sidebar shows up.

    try this : in tiga.php
    * Override the default 'Links' widget
    function tiga_links_widget($args)
    global $wpdb;
    /* Links from the 'Links Manager' */
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->categories WHERE link_count>0");
    foreach ($link_cats as $link_cat)
    if (get_links($link_cat->cat_id, '', '', '', FALSE, '', FALSE, FALSE, -1, FALSE, FALSE))
    echo '<li class="left-wp-widget %2$s">' .
    $before_title . $link_cat->cat_name . $after_title .
    echo '</ul>

    in bookmark-tamplates.php

    /** function wp_get_links()
    ** Gets the links associated with category n.
    ** Parameters:
    ** category (no default) - The category to use.
    ** or:
    ** a query string
    function wp_get_links($args = '') {
    global $wpdb;
    if ( empty($args) )
    if ( false === strpos($args, '=') ) {
    $cat_id = $args;
    $args = add_query_arg('category', $cat_id, $args);
    if ( !isset($category) ) $category = -1;
    if ( !isset($before) ) $before = '';
    if ( !isset($after) ) $after = '<br />';
    if ( !isset($between) ) $between = ' ';
    if ( !isset($show_images) ) $show_images = false;
    if ( !isset($orderby) ) $orderby = 'rand';
    if ( !isset($show_description) ) $show_description = false;
    if ( !isset($show_rating) ) $show_rating = false;
    if ( !isset($limit) ) $limit = -1;
    if ( !isset($show_updated) ) $show_updated = 1;
    if ( !isset($echo) ) $echo = true;
    return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo);
    } // end wp_get_links

    replace line 119 of bookmarks.php by

    $orderby = 'rand()';//"link_" . $orderby;

    it works : have a look

    Where is the bookmark-tamplates.php and bookmarks.php files???

    it is in your wp-includes directory!

    I don’t see the bookmark-tamplates.php and bookmarks.php files either, and I search both the wp-includes and other directories. I am using WP 2.0; are they in 2.1?

    Any suggestions for correcting this problem in 2.0?


    Still haven’t gotten assistance with this. And the bookmark-templates.php or bookmarks.php don’t exist in my version of Tiga.

    Tried the earlier suggestion, but am getting a similar error. Breaks the page and only displays the left sidebar. I believe the error is that wp_list_bookmarks is not defined as a function.

    Can anyone provide code that does define it?


    Whatever the problem was, it been resolved. Going over several topics on this in this forum, I wondered if it was just a bad combination of WP2.0 and the Tiga theme. Must have been, as when I reloaded the original Tiga code for the Links after upgrading to the latest WP, all is well with the world… or at least with the links list.

    Where can one find the original Tiga code for the Links?

    None of the above has worked for me.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Links in Tiga Theme’ is closed to new replies.