i try to work with code i find online.
In detail: http://www.rinconstrategies.io/custom-gallery-shortcode-for-wordpress.html
I use and make debug and i see problem with parse.
<?php
function create_gallery_view( $atts ) {
$images = get_field('gallery_view');
$innerHTML = '';
foreach( $images as $image ) {
$thumb = $image['sizes']['thumbnail'];
$alt = $image['alt'];
$caption = $image['caption'];
$innerHTML .= "<li>
<img src=$thumb alt=$alt />
<p>$caption</p>
</li>";
}
$html = <<<HTML
<ul class="gallery-view-flex">
{$innerHTML}
</ul>
HTML;
echo $html;
}
add_shortcode('gallery_view', 'create_gallery_view');
?>
In my debug the line have some problem.
$html = <<<HTML
<ul class="gallery-view-flex">
{$innerHTML}
</ul>
HTML;
echo $html;
I read online heredoc have this format. But i motivi understand why debug say about parse problem.
Someone can help me for understand? thanks Paolo