WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
[resolved] Invalid foreach() on line 986 (4 posts)

  1. brettgoodrich
    Member
    Posted 1 year ago #

    Hey guys!

    http://www.horizonindy.org

    Just upgraded to Simple Fields 1.0 and got this in place of the slider images Simple Fields was generating for me:
    Warning: Invalid argument supplied for foreach() in (stuff)/wp-content/plugins/simple-fields/simple_fields.php on line 986

    Is this a problem with my code or 1.0? Worked fine on 0.5.

    ALSO: With the new functions, how do I get a field value from a different page than the one I'm on?

    http://wordpress.org/extend/plugins/simple-fields/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 1 year ago #

    I just added version 1.0.1. Can you check if that version solves it?

  3. Pär Thernström
    Member
    Plugin Author

    Posted 1 year ago #

    Oh, regarding getting a field from a different page that the current one in the loop:

    // get a field from post with id 123
    $myValue = simple_fields_value("myFieldSlug", 123);
    echo "the value is: $myValue";

    See more on the document page for this function:
    http://simple-fields.com/documentation/api/getting-values/simple_fields_value/

  4. brettgoodrich
    Member
    Posted 1 year ago #

    It did fix it, thank you very much! And that's exactly what I was looking for. You're awesome.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.