WordPress.org

Ready to get started?Download WordPress

Forums

warning invalid argument supplied for foreach() (5 posts)

  1. Amit Kvint
    Member
    Posted 2 years ago #

    Hi there,

    Am using WordPress for a while now, but am quite novel to PHP.

    I get this error message trying to run a theme developed by another developer. it referes to two lines on the header.php code which I am pasting here :
    line 9 - foreach ($options as $value) {
    line 46 - foreach ($options as $value) {

    If I understood correctly from reading I have made the problem could be that the foreach is used here althogh it's not referring to an array (?)

    Is that true ? and if so where and how can I change the code so it'll work properly.
    Thanx :)

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    could you paste the whole code of header.php into a http://pastebin.com/ and post the link to it here?

  3. Amit Kvint
    Member
    Posted 2 years ago #

    Just wanted to update that these errors came when previewing and now on my local seems to have disappeared once I have activated the theme - does that makes sense to anyone ?

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    makes perfect sense - the option values are possibly filled in now.

  5. Amit Kvint
    Member
    Posted 2 years ago #

    So just for future understanding where are the values for the option are set - I could not find them on the header.php

Topic Closed

This topic has been closed to new replies.

About this Topic