Home › Forums › Add-ons › Gallery Field › Flexslider Insert from URL › Reply To: Flexslider Insert from URL
For anyone wanting to loop images from another source using Flexslider.
I created a ‘text area’ field type and split the urls with a pipe (|).
www.domain.com/img/01.jpg|www.domain.com/img/02.jpg|www.domain.com/img/03.jpg
<div id="slider" class="flexslider">
<ul class="slides">
<?php
$string = get_field( 'slider' );
$split = explode ( '|', $string );
$split = array_reverse($split);
foreach($split as $img){
echo "<li><img src='{$img}' /></li>";
}
?>
</ul>
</div>
Remove $split = array_reverse($split);
for normal order.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.