Support » Plugins and Hacks » [Plugin: The Events Calendar] Bug with WooThemes and Fatal error

  • Resolved mikeyleung.ca

    (@mikeyleungca-1)


    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'"); ?>

Viewing 1 replies (of 1 total)
  • grumbirky

    (@grumbirky)

    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!

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: The Events Calendar] Bug with WooThemes and Fatal error’ is closed to new replies.