Invalid Argument foreach


Is this because of WordPress, PHP, or the Theme? (or some combination)

A client of mine has a WordPress site that’s been working just fine for years, but recently started getting the following errors pulling up in it’s sidebars:

Warning: Invalid argument supplied for foreach() in /wp-content/themes/epsilon/page-threecolumn.php on line 29

Been thinking it may have to do with upgrades to both WordPress and PHP. Theme is no longer supported. Here is what the code looks like in that area:

                <div class="col-234">
                    <div class="sidebar left-sidebar">
                            $leftsidebar = simple_fields_get_post_group_values($post->ID, "Left Sidebar", false, 2);
                            foreach ($leftsidebar as $value) { 
                                <h2> <?php echo $value[1]; ?></h2>
                                        if (function_exists('cforms_insert')){ 
                                            echo cforms_insert(do_shortcode($value[2])); 
                                        } else { 
                                            echo do_shortcode($value[2]); 
                            <?php } ?>

I did not build the site. And while I am proficient in pure HTML, I know little about PHP. Is this just a syntax issue that can be resolved with some quick fixes? Or do I need to go out and install a completely new theme (which scares the heck out of me)?

, Daddio 2 years 2019-12-26T18:08:20-05:00 0 Answers 72 views 0

Leave an answer