Tuesday, December 13, 2022
HomeWordPress Developmentplugins - owl carousel + ACF Photograph Gallery Discipline

plugins – owl carousel + ACF Photograph Gallery Discipline


I thanks prematurely to your time.
I’ve an issue on create the loop by combining owl carousel and ACF Photograph Gallery Discipline plugin. I put the photographs within the backend and thru the code I see them one beneath the opposite. The slide would not work…

<div class="col">
        <?php
            //Get the photographs ids from the post_metadata
            $photographs = acf_photo_gallery('slide', $post->ID);
            $i=0;
            //Verify if return array has something in it
            if( rely($photographs) ):
                //Cool, we acquired some information so now let's loop over it
                foreach($photographs as $picture):
                    $id = $picture['id']; // The attachment id of the media
                    $title = $picture['title']; //The title
                    $caption= $picture['caption']; //The caption
                    $full_image_url= $picture['full_image_url']; //Full dimension picture url
                    $full_image_url = acf_photo_gallery_resize_image($full_image_url, 262, 160); //Resized dimension to 262px width by 160px top picture url
                    $thumbnail_image_url= $picture['thumbnail_image_url']; //Get the thumbnail dimension picture url 150px by 150px
                    $url= $picture['url']; //Goto any hyperlink when clicked
                    $goal= $picture['target']; //Open regular or new tab
                    $alt = get_field('photo_gallery_alt', $id); //Get the alt which is a further area (See beneath  add further fields)
                    $class = get_field('photo_gallery_class', $id); //Get the category which is a further area (See beneath  add further fields)
            ?>
                    <div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="true">
            <div class="carousel-indicators">
                <button sort="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="lively" aria-current="true" aria-label="Slide 1"></button>
                <button sort="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
                <button sort="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
            </div>
            <div class="carousel-inner">
                <div class="carousel-item lively">
                    <img src="<?php echo $full_image_url; ?>" class="d-block w-100" alt="..."/>
                </div>
            </div>
            <button class="carousel-control-prev" sort="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="visually-hidden">Earlier</span>
            </button>
            <button class="carousel-control-next" sort="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="subsequent">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="visually-hidden">Subsequent</span>
            </button>
        </div>
        <?php endforeach; endif; ?>
    </div>

Thanks very a lot to your assist

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments