Hallo,
ik probeer om srcset function toe te voegen in mij theme maar ik krijg foutmelding op lijn 252. ik probeerde om uit te vinden maar is niet gelukt.
deze is de code:


// Class
$class = implode(' ', apply_filters('john_img_class', $class));
if (!empty($class)) {
$class = 'class="' . esc_attr($class) . '"';
}
// Aspect ratio
$ratio = john_sizes_ratio($width, $height);
if (!empty($ratio)) {
$ratio = 'data-aspect-ratio="' . esc_attr($ratio) . '"';
}
// Attributes
$attributes = implode(' ', apply_filters('john_img_attributes', array('id' => 'id="wp-image-' . esc_attr($id) . '"', 'data-id' => 'data-id="' . esc_attr($id) . '"', 'class' => $class, 'ratio' => $ratio, 'schema' => 'itemprop="contentUrl"', 'alt' => 'alt="' . $alt . '"')));
// Return an array with the final width/height so these values can be passed up to the wrapper element for certain CSS styling tricks
return array(apply_filters('john_img', '<img ' . apply_filters('john_src_html', $src) . apply_filters('john_srcset_html', $srcset) . apply_filters('john_sizes_html', $sizes) . apply_filters('john_dimensions', image_hwstring($width, $height), $width, $height) . $attributes . '>'), $width, $height);



waar het kan de fout zijn , ik kunde niet vinden?
dank u wel
johannes
Mocht je vaker werken met PHP of andersoortige code, dan kan ik je aanraden om een IDE te gebruiken die je attendeert op dit soort fouten, dan hoef je niet te wachten op input van anderen.
Een goede en gratis IDE kan je hier vinden: https://www.eclipse.org/pdt/
Er zijn een boel die zweren bij PhpStorm (https://www.jetbrains.com/phpstorm/) maar ik zie niet in waarom je zou betalen voor iets dat je ook gratis kan krijgen.

Reageren