My Website: is throwing an error that I have been unable to resolve

I'm not sure what was added/removed but now I get an: Notice: is_main_query was called incorrectly. In pre_get_posts, use the WP_Query->is_main_query() method, not the is_main_query() function. See Please see Debugging in WordPress for more information. (This message was added in version 3.7.0.) in /home3/lrevell8/ on line 4147

  • Nahid
    • Tech Support

    Hey lamont !
    Hope you are having a great day!

    As this is just a PHP notice, you can simply disable them from showing up in your site by putting some constants in the wp-config.php file. Log into your site's FTP/cPanel File Manager and look for the wp-config.php file, it should be located in the root directory of your installation where folders like wp-admin, wp-content and wp-includes are placed. Please store a backup of the file before editing it. Open the file and look for the following line:

    define( 'WP_DEBUG', false );

    Note: It might be set to 'true' as well. Replace it with the following lines:

    ini_set('display_errors', 'Off');
    ini_set('error_reporting', E_ALL );
    define('WP_DEBUG', false);
    define('WP_DEBUG_DISPLAY', false);

    Note: These definitions might already be there but with different values. Make sure they are replaced with the respective definitions so that there are no duplicates, otherwise the site might run into a fatal error.

    These lines will simply prevent the notice from showing up to the visitors. You can know more about debugging in WordPress here.

    Though PHP notices/warnings are not a very big deal unless it has any impact on the functionality of your site, but what if you want to troubleshoot and fix the issue? According to the context of the notice, it looks like the theme/a plugin is using a function in a way that WordPress doesn't recommend. You can firstly determine what is causing the issue by doing a simple plugin/theme conflict test and report the issue to the authors of the specific plugin/theme. This handy flowchart will help you do a conflict test.

    Hope this helps. Let me know if you need any further assistance regarding this. Thanks!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.