Support » Plugin: AMP for WordPress » Warning: Invalid argument supplied

  • This error is coming up at top of page on one of the posts when viewed as AMP. Others so far ok (and Version 0.4 seems to have fixed many of the problems).

    Warning: Invalid argument supplied for foreach() in /wp-content/plugins/amp/includes/utils/class-amp-dom-utils.php on line 48

    This was one where I was fixing some know errors. So expecting the post to past validation except for the text appearing at the very top, which of course now errors!

    Anything obvious?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mohammad Jangda


    There’s a fix here:

    I’d also suggest setting display_errors in your php settings to off and instead writing them to a log file instead.

    Did the fix adjusting the AMP file as suggested. Those pages now work. Found one unrelated error which I was also able to correct.

    Majority of the posts are now working ok. Still have 174 posts which I need to check what the errors are. But does look manageable now.

    I bear in mind your suggestion on changing the setting to php.

    Well done, Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Warning: Invalid argument supplied’ is closed to new replies.