I'm using the Advanced Custom Fields Pro plugin and its Flexible Fields
I'm getting the following PHP warning for each layout related to the implode I'm using on the $displayCat variable:
Warning: implode() [function.implode]: Invalid arguments passed in /server-path/wp-content/themes/theme-name/page-home.php on line XX
I thought it was because $displayCat wasn't always an array, so tried to put $displayCat = array(); but that didn't eliminate the warnings.
Any ideas?
if( have_rows('home_content') ):
// loop through the rows of data
while ( have_rows('home_content') ) : the_row();
// 1x1 Nav
if( get_row_layout() == '1x1_nav' ):
$img = get_sub_field('img');
$alt = get_sub_field('alt');
$url = get_sub_field('url');
$displayCat = implode('" "', get_sub_field('display_cat'));
get_sub_field('display_cat')should return a single field...get_sub_field()cannot return an array... You could only usewhileloops to iterate over the values...get_sub_field()is a function from a WordPress plugin function, it doesn't make this question invalid on SO. The error is a PHP error, caused by incorrect use of PHP functions. It has nothing to do with WordPress.