• Resolved jess888

    (@jess888)


    Suddenly getting this error on some pages of client’s site:
    Warning: Invalid argument supplied for foreach() in /home/65/91/2909165/web/wp-content/themes/make/inc/builder/setup.php on line 95

    Here is the code in that area:

    public function read_layout( $sections, $post_id ) {
    		$layout = get_post_meta( $post_id, '_ttfmake_layout', true );
    
    		if ( ! empty( $layout ) ) {
    			$layout = maybe_unserialize( $layout );
    			$sections = array();
    
    			foreach ( $layout as $section_id ) {
    				$section = get_post_meta( $post_id, "_ttfmake_section_{$section_id}", true );
    				$section = maybe_unserialize( $section );
    				$sections[] = $section;
    			}
    		}
    
    		return $sections;
    	}

    This is what is on line 95:
    foreach ( $layout as $section_id ) {

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jess888

    (@jess888)

    Resolved it myself – thanks. You can delete this post.

    michigoogie

    (@michigoogie)

    Hi @jess888,

    I get the same error currently. How have you resolved it by yourself?

    Your help is much appreciated.

    Thanks!

    Thread Starter jess888

    (@jess888)

    Hi there michi ~

    I wish I could remember!

    I suggest turning off all plugins and testing the site; that is the most likely thing. Also, think about what you might have done before just before the error occurred, of course. Last resort: restore a backup….

    Sorry!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“Warning: Invalid argument….”’ is closed to new replies.