Invalid argument supplied for foreach()

You will get this error if foreach() is not an array. So your first step should be to debug this by inspecting the contents of $results to confirm that the results are what you expect. If it’s not then it might give you clues to why. This is debugging 101. If you do that you’ll … Read more

How to get an error message if a form is empty (plugin: Post for site) [closed]

You’ve already got a check for $_POST == empty. **if (!empty($_POST)){ $pfs = pfs_submit($_POST,$_FILES); echo json_encode($pfs); //echo “<pre style=\”border:1px solid #ccc;margin-top:5px;\”>”.print_r($pfs, true).”\n”; wp_redirect(“http://domda.se/tack/”); exit; } else { /* TODO: translate following */ _e(‘Den här sidan hade du inte behövt se, nÃ¥got är fel.’,’pfs_domain’); echo “<a href=””.get_bloginfo(“url’).”‘>” . __(‘Go home?’,’pfs_domain’) . “</a>”; }** Add an error … Read more

Sidebar Slideshow widget with text [closed]

I don’t think this StackExchange is meant to recommend plugins. However, I happen to have built this for a client before. It uses jQuery’s “jCaroussel” plugin, and you can see it in action on Oelers Makelaardij. Scoop up the minified version, it contains all plugins like Autoscrolling, Controls, etc. CSS Most of the CSS is … Read more