Home » Topics » General Support » Undefined variable: acfw

Undefined variable: acfw

ACF Widgets Support General Support Undefined variable: acfw

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #103580


    Just purchased a license for single site installation. I’m adding a repeater to a widget and am receiving the following PHP error:

    Notice: Undefined variable: acfw in widget-sponsors.php on line 3

    ACF Pro version 5.5.14
    Wordpress version 4.8

    Here is the source:

    		// check if the flexible content field has rows of data
    			if( have_rows('sponsor_list', $acfw) ):
    			// loop through the rows of data
    			while ( have_rows('sponsor_list', $acfw) ) : the_row();
    			// check current row layout
    			$logo = get_sub_field('sponsor_logo', $acfw);
    					<li class="slide"><img src="<?php echo $logo['image'];  ?>" alt="<?php echo $logo['alt'] ;?>" /></li>
    			else :
    			// no layouts found

    Assistance would be greatly appreciated. Thank you

    Daron Spence


    I’m not sure what the problem is here. Can you experiment with a single field type? Maybe something has changed under the hood in ACF that I need to fix regarding repeaters.

    I don’t know if you have this online somewhere, but if you do, you can post a private reply here in the forum (only I can see it) with login credentials, and I can try to take a look more directly.



    Hey Daron,
    I migrated from a development server to a staging server and the error resolved. Must be something with the dev config.

    Thank you for your response

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Undefined variable: acfw’ is closed to new replies.