WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: The Events Calendar] Bug with WooThemes and Fatal error (2 posts)

  1. mikeyleung.ca
    Member
    Posted 4 years ago #

    WooThemers out there beware:

    The Events Calendar plugin will break your theme because of this code used in the header.php of some WooThemes.

    This is the error:
    Fatal error: Call to a member function get_var() on a non-object in MY SITE HIDDEN/wordpress/wp-content/themes/dailyedition/header.php on line 69

    The culprit code:

    <?php $cat = get_option('woo_video_category'); $GLOBALS[vid_cat] = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name='$cat'"); ?>

    If you're a WooTheme user-coded there's a fix in their forum here:

    http://forum.woothemes.com/topic.php?id=10642

    Replace with:

    <?php global $wpdb; $cat = get_option('woo_video_category'); $GLOBALS[vid_cat] = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name='$cat'"); ?>

  2. grumbirky
    Member
    Posted 4 years ago #

    This has nothing to do with Events Calendar, or WooThemes, but I had a similar problem, which was also fixed by adding global $wpdb; in front of my database query.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic