vendredi 6 mai 2016

Advanced Custom Fields get sub field slide image

When i use this type of code

<?php echo get_sub_field('slide_image')['url']; ?>

then it's give me a

Parse error: syntax error, unexpected '[', expecting ',' or ';' in /home/sites/http://ift.tt/1q4oNDJ on line 9

this sort of error so what can i do in this situation. my total code is below

<?php if(have_rows('banner_slides')): // if have rows ?>

    <div class="slideshow slideshow--banner" data-palm="palm-hidden">

        <span id="prev" class="cycle-prev"><</span>

        <?php while ( have_rows('banner_slides') ) : the_row(); // Loop through slides ?>

            <div class="slideshow__slide" style="background-image: url(<?php echo get_sub_field('slide_image')['url']; ?>);">



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire