WordPress.org

Ready to get started?Download WordPress

Forums

WP Opulus
[resolved] Front page - Fatal Error message (3 posts)

  1. rrfxk
    Member
    Posted 8 months ago #

    I don't know what I did, but now when I type in the url for my blog I get the title, the subheading, and instead of the three demo pics with a brief summary I see this message:

    Fatal error: Call to a member function get() on a non-object in /home2/rrfxk/public_html/wp-includes/query.php on line 27

    Anyone know what that means? I reset the Opulus theme because I assumed I made a mistake somewhere along the way. But I have no idea what I did to conjure this without-results-google-search madness. Any and all help is appreciated!

    Becky

  2. NighthawkCH
    Member
    Posted 8 months ago #

    I had the same error. It was a problem with WP Opulus and the plugin NextGen Gallery. When I deactivated the plugin all works fine. But deactivating the plugin can't be the solution.

    After a few tests I figured out that the problem are this lines in the featured.php:

    $original_query = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query(array('page_id' => $left_featured, 'posts_per_page' => 1));

    This codeblock is 3 times in the file for left, center and right post.

    I found 2 solutions but I don't know why it works (I'm new in WP), I only know "It works for me for the moment".

    Solution 1: Comment out $wp_query = null;
    Solution 2: Change $wp_query = new WP_Query(arr... ' => 1)); to $wp_query = new WP_Query() and after this line add $wp_query->query('page_id='.$left_featured.'&posts_per_page=1');. Don't forget to change the variable (left, center, right).

    I hope it will help.

  3. rrfxk
    Member
    Posted 8 months ago #

    Thank you so much!

    Oddly, I thought to try your solution 2 before solution 1; solution 1 just seemed too easy. Solution 2 didn't work for me so then I tried solution 1 and presto! I'm up and running. Thank you so much for the help. I am new to WP and to editing code. This successful little experience gave me a boost :)

    Cheers to you NighthawkCH!

    -Becky

Reply

You must log in to post.

About this Theme

About this Topic