• Resolved mlargue

    (@mlargue)


    Just recently I installed Code Snippets (Zero Snippets), which caused my system to “white screen” crash with the following errors:

    Fatal error: Uncaught Error: Call to a member function have_posts() on null in /home/doodledoo/public_html/wp-includes/query.php:767 Stack trace: #0 /home/doodledoo/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(352) : eval()’d code(1): have_posts() #1 /home/doodledoo/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(352): eval() #2 /home/doodledoo/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(425): execute_snippet(‘ if ( have_post…’, 1) #3 /home/doodledoo/public_html/wp-includes/class-wp-hook.php(286): execute_active_snippets(”) #4 /home/doodledoo/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home/doodledoo/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/doodledoo/public_html/wp-settings.php(327): do_action(‘plugins_loaded’) #7 /home/doodledoo/public_html/wp-config.php(92): require_once(‘/home/doodledoo…’) #8 /home/doodledoo/public_html/wp-load.php(37): require_once(‘/home/doodledoo…’) #9 /home in /home/doodledoo/public_html/wp-includes/query.php on line 767

    Line 767 seems to feature prominently and I suspect database errors. Can anyone assist in establishing the root cause and advise on how to fix the problem?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi,

    This error is originating from the code in one of your snippets, one which is trying to use the loop but not setting it up properly. It has nothing to do with the database.

    In order to get back into your site, you can follow this method, and then I would go through your snippets looking for one which calls have_posts() on the first line. You will need to fix this snippet before reactivating it, probably by wrapping your code in a filter hook.

    If you would like help with this last step, feel free to post some of your code here and I can give you some tips on how to sort it out.

    Thread Starter mlargue

    (@mlargue)

    Thanks Shea

    I have managed to resolve the issue with your help.

    Kind Regards
    Michael

    Plugin Author Shea Bunge

    (@bungeshea)

    That’s great to hear! Sorry for not getting back to you sooner.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Code Snippets Crashes My System’ is closed to new replies.