Here is my function
function yyy_hero_image_option_callback() {
$hero_options = get_option( \'hero_options\' );
$count=count($hero_options);
$totalimg=$coun
The way you changed your code, $i
is not set anymore, try this :
foreach ($hero_options as $key => $value) {
if (strpos($key, '_zzz_')) {
$i = substr($key, -1); // This will retrieve the last char of $key, which is corresponding to your previous $i
$html = '';
$html .= '';
$html .= ' ';
$html .= ' ';
$html .= '';
echo $html;
}
}
I also replaced the $hero_options[key]
parts by $value
, since you already get it from the foreach.