WordPress.org

Ready to get started?Download WordPress

Forums

PHP Code Widget
[resolved] Fatal Error: Call to member function (4 posts)

  1. Tech4Eleven
    Member
    Posted 7 months ago #

    Im not sure where my php code is wrong but Im getting this on the front end of my site:
    '
    Fatal error: Call to a member function getOption() on a non-object in /home/ohanapie/public_html/wp-content/plugins/php-code-widget/execphp.php(27) : eval()'d code on line 2
    '

    my php code is:

    '
    <?php
    if ($gummWpHelper->getOption('banda_header_countdown_display') === 'true') {
    View::renderElement('header/event-countdown-timer');
    }
    ?>
    '

    My guess is that the widget can't call the function? Any help is appreciated. Im trying to render an event countdown in my sidebar that i originally omitted from the header.php

    http://wordpress.org/plugins/php-code-widget/

  2. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 7 months ago #

    You don't have "$gummWpHelper" defined anywhere, so it's not a valid object.

    See the third answer in the FAQ:

    http://wordpress.org/plugins/php-code-widget/faq/

  3. Tech4Eleven
    Member
    Posted 7 months ago #

    ah. i have no idea how to do that but thanks for the heads up.

  4. Tech4Eleven
    Member
    Posted 7 months ago #

    turns out i didn't need half of that code. this worked for me:

    '
    <?php
    View::renderElement('header/event-countdown-timer');
    ?>
    '

    great plugin. thanks!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.