WordPress.org

Ready to get started?Download WordPress

Forums

Links in Tiga Theme (15 posts)

  1. dgstinner
    Member
    Posted 7 years ago #

    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'-->
    <?php
    $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>
    <div class="left-widget">
    <ul>
    <?php wp_get_links($link_cat->cat_id); ?>
    </ul>
    </div>
    <?php
    }
    }
    ?>
    <!-- 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

  2. CFCMatt
    Member
    Posted 7 years ago #

    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.
    Matt

  3. rtcunningham
    Member
    Posted 7 years ago #

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

    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;
    border-style:solid;
    color:#000000;
    background-color:#FFFFFF;
    padding:0px 5px 5px 5px;
    margin-top: 0px;
    margin-bottom:5px;
    }
    .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;
    border-style:solid;
    font-size:9pt;
    font-weight: bold;
    padding:5px;
    margin:-0px -5px 5px;
    }
    .bookmarks li{
    list-style: none;
    margin-bottom:5px;
    }
    .bookmarks ul{
    list-style-type:none;
    padding-left:7px;
    margin-top:0px;
    margin-left:0px;
    }

    If anyone has better CSS or a better idea, please send email to me: ninong1@gmail.com

  4. dgstinner
    Member
    Posted 7 years ago #

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

  5. chrisos
    Member
    Posted 7 years ago #

    try this : in tiga.php
    /*
    * Override the default 'Links' widget
    */
    function tiga_links_widget($args)
    {
    global $wpdb;
    extract($args);
    /* 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 .
    '
    <ul>';
    wp_get_links($link_cat->cat_id,$args);
    echo '</ul>
    '.
    $after_widget;
    }
    }
    }

  6. chrisos
    Member
    Posted 7 years ago #

    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) )
    return;
    if ( false === strpos($args, '=') ) {
    $cat_id = $args;
    $args = add_query_arg('category', $cat_id, $args);
    }
    parse_str($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

  7. chrisos
    Member
    Posted 7 years ago #

    replace line 119 of bookmarks.php by

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

  8. chrisos
    Member
    Posted 7 years ago #

    it works : have a look
    http://scope.chrisos.com/

  9. fmassuia
    Member
    Posted 7 years ago #

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

  10. chrisos
    Member
    Posted 7 years ago #

    it is in your wp-includes directory!

  11. Tfleming
    Member
    Posted 7 years ago #

    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?

    http://www.civicyouth.org/wordpress

    Thanks!

  12. Tfleming
    Member
    Posted 6 years ago #

    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?

    Thanks!

  13. Tfleming
    Member
    Posted 6 years ago #

    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.

  14. pautzee
    Member
    Posted 6 years ago #

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

  15. pautzee
    Member
    Posted 6 years ago #

    None of the above has worked for me.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags