WordPress.org

Ready to get started?Download WordPress

Forums

foreach() error in sidebar.php (1 post)

  1. mAg
    Member
    Posted 9 years ago #

    Running wp 1.5, a modified Connections (renamed to Gone_Fishing) theme, and I recently added Weather Report plugin.

    Periodically, I get the following error:
    Warning: Invalid argument supplied for foreach() in /var/www/html/wordpress/wp-content/themes/gone_fishing/sidebar.php on line 4


    <?php
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories WHERE (cat_id <> 19) ORDER BY cat_id desc");
    foreach ($link_cats as $link_cat) {
    ?>
    <h2 id="linkcat-<?php echo $link_cat->cat_id; ?>">
    <?php echo $link_cat->cat_name; ?></h2>
    <ul>
    <?php wp_get_links($link_cat->cat_id); ?>
    </ul>
    </li>
    <?php } ?>

    Click Reload in Firefox, and the sidebar displays fine.

    URL: http://www.ality.org/wordpress/
    Would really like to see the error go away permanently. Seems that when the error is returned, that there seems to be a longer than usual wait for anything to render in the browser.

Topic Closed

This topic has been closed to new replies.

About this Topic