Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter nicolargo

    (@nicolargo)

    If i change the canonical.php script by replacing this section line 53:

    foreach ( $wp_query->tax_query as $tax_query )
        $term_count += count( $tax_query['terms'] );

    by this code:

    if (is_tax()) {
       foreach ( $wp_query->tax_query as $tax_query )
         $term_count += count( $tax_query['terms'] );
    }

    The problem is solved…

    Thread Starter nicolargo

    (@nicolargo)

    Patch needed on WordPress ?

    Thread Starter nicolargo

    (@nicolargo)

    Mmhh, did not solve all the issue a better patch will be:

    replace:

    foreach ( $wp_query->tax_query as $tax_query )
        $term_count += count( $tax_query['terms'] );

    by:

    foreach ( (array) $wp_query->tax_query as $tax_query )
        $term_count += count( $tax_query['terms'] )

    It works now when i try todisplay my category:

    http://blog.nicolargo.com/category/open-source

    But when i try to get the feed for that category (http://blog.nicolargo.com/category/open-source/feed), i have the following error on the XML file:

    <b>Warning</b>: Invalid argument supplied for foreach() in <b>/srv/d_bilbo/web/blog/wp-includes/canonical.php</b> on line <b>153</b>

    thank you so muchhhh… nicolargo, you are very genius!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Warning: Invalid argument supplied for foreach() in /wp-includes/canonical.php’ is closed to new replies.