WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: The Events Calendar] Call to a member function get_var() on a non-object (15 posts)

  1. kenrob1372
    Member
    Posted 5 years ago #

    Hey I'm getting this error on the events posts and the calendar page:

    Fatal error: Call to a member function get_var() on a non-object in D:\Hosting\4529152\html\bryant\wp-content\themes\classifiedtheme\footer.php on line 8

    here's lines 7 and 8:

    if(!isset($GLOBALS['hide_footer_bar'])){
    $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");

    Thanks,
    Ken

  2. ide79
    Member
    Posted 5 years ago #

    I have the same problem with $wpdb (query) in the event posts and the calendar page

  3. ide79
    Member
    Posted 5 years ago #

    ok. how about this way
    add global $wpdb; before the query

    global $wpdb;
    if(!isset($GLOBALS['hide_footer_bar'])){
    $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
  4. Shane Pearlman
    Modern Tribe
    Posted 5 years ago #

    I'll ask around and see if we can duplicate it.

  5. mattyshack
    Member
    Posted 5 years ago #

    Getting the same thing

    Fatal error: Call to a member function get_var() on a non-object in /home/dig/public_html/wp-content/themes/freshnews/includes/version.php on line 7

  6. mattyshack
    Member
    Posted 5 years ago #

    I still get the same error when updating to the latest plug in. Guess these don't work with Woo Themes.

  7. mattyshack
    Member
    Posted 5 years ago #

    And yes, I am running PHP 5.1.30

  8. Noah_Eventbrite
    Member
    Posted 5 years ago #

    Hey mattyshack,

    Just a friendly reminder that the Dev Team will return from vacation in one week. I'm sure they will provide an answer when they return. In the meantime, does anyone else have any ideas?

    Thanks,

    - Noah

  9. thebushman
    Member
    Posted 5 years ago #

    I'm getting something similar


    Fatal error: Call to a member function get_var() on a non-object in /mnt/w1007/d27/s19/b02a4550/www/ykonline.ca/wp-content/themes/gazette/header.php on line 70

  10. mikeyleung.ca
    Member
    Posted 5 years ago #

    I posted a solution to this over on the WooThemes forums. If you're a member over there you should be able to find it on the search..

  11. digitalduckinc
    Member
    Posted 5 years ago #

    I have a similar problem but I don't believe my theme is from Woothemes.

    It's Flexolio from Theme Forest.

    The widget seems to work but when I click on VIEW ALL EVENTS or MORE INFO, I get this:

    Fatal error: Call to a member function get_var() on a non-object in /home/otab/public_html/demo/wp-content/themes/flexolio/var.php on line 11

  12. thebushman
    Member
    Posted 5 years ago #

    @Mikeyleung.ca
    I couldn't find your solution in the Woo Forums, got the link?

    Although I do think I found a solution for me anyways. I looked at line 70 in my header (Where the error was) and just deleted that line, as it was for a feature I don't use.

  13. mattyshack
    Member
    Posted 4 years ago #

    mikeyleung, Can't find that post anywhere. Searched and searched and nothing.

  14. headwatersmedia
    Member
    Posted 4 years ago #

    The link to the mikeyleung fix on the Woo Themes Support Forum is here:
    <a href="http://http://forum.woothemes.com/topic.php?id=10642"> but I think a password is required (members only). Not sure. (I am a member.)

    Actually, here are portions of the exchanges...hope this is ok to post. I've removed identities...so buyer beware

    ****************

    [excerpted from woo themes support forum]

    This problem has to do with the WooThemes Gazette theme and not the plugin. I had the same problem some months ago and ended up having to modify the header.

    After upgrading to the new version of the theme, I of course lost my header modifications and have the exact same problem on line seventy of the header.php.

    "Fatal error: Call to a member function get_var() on a non-object in .../ifcnews/wp-content/themes/gazette/header.php on line 70"

    If I recall how I solved it last time I will post here.

    [cont'd]

    The problem is with line 139 ... it should now read:

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

    instead of what goes with the theme:

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

    It is this error in the theme header.php file which is causing the get_var Fatal error.

  15. mattyshack
    Member
    Posted 4 years ago #

    Yeah, I've tried that fix. but I have the Fresh News theme and my line that is causing the error is different. Its from line 41 in the header.php file

    <?php
    	// Set Global variables for use in exclude
    	$asides_cat = get_option('woo_asides_category');
    	$GLOBALS[asides_id] = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name = '$asides_cat'");
    	$video_cat = get_option('woo_video_category');
    	$GLOBALS[video_id] = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE name = '$video_cat'");
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic