WordPress.org

Ready to get started?Download WordPress

Forums

Strange error code appearing in empty sub categories (5 posts)

  1. Dazza30
    Member
    Posted 2 years ago #

    Please can someone advise,

    Ive noticed this error message appear above the page of empty sub categories

    Warning: Invalid argument supplied for foreach() in /home/prepayas/public_html/blog/wp-includes/query.php on line 2746

    Here is my blog blog.pre-pay-as-you-go.co.uk to view the error in the main silver navigation bar go to Videos and choose Handset Videos/Apple or alternatively Mobile gaming and then Windows phone 7 games

    What could be causing this and how can I rectify it?

  2. webdevsonline
    Member
    Posted 2 years ago #

    Ideally, you need to know what you've done to alter that, as I've not come across it with a vanilla install of wordpress before.

    You should, take a backup of your site, wamp/lamp it and work on the issue. But in the mean time on your live site you can put in:

    error_reporting(0);

    Refer to: http://php.net/manual/en/function.error-reporting.php

    However like I said, go local and see whats been altered in your site from the original pages?

    Web Devs Online.

  3. Dazza30
    Member
    Posted 2 years ago #

    To be honest I dont understand PHP all to well so I know I havent done anything within the query-php include file. In fact when I found the file in Cpanel file manager it says the file was last updated on the 29th of December.

    Here's the code I think the error is refering to with line 2746 beginning with foreach.

    // Always sanitize
    		foreach ( $this->posts as $i => $post ) {
    			$this->posts[$i] = sanitize_post( $post, 'raw' );

    As Ive no idea what I'm looking at and dont understand the code I have no idea how to resolve this!

    Do you have any further advice?

  4. Dazza30
    Member
    Posted 2 years ago #

    Is there anyway of testing plugins to see if they are causing the problem?

  5. keesiemeijer
    moderator
    Posted 2 years ago #

    try:

    - deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

Topic Closed

This topic has been closed to new replies.

About this Topic