Home › Forums › Add-ons › Gallery Field › Jetpack carousel for gallery field › Reply To: Jetpack carousel for gallery field
I just read this here: http://jetpack.me/support/carousel/
With Carousel active, any standard WordPress galleries you have embedded in posts or pages will launch a gorgeous full-screen photo browsing experience with comments and EXIF metadata.
This means that if you have jetpack carousel active and you put your images into a WP gallery that it will automatically cause it to be a jetpack carousel.
So the code you need is almost exactly what is in the acf gallery document I linked to above. Her it is with a little more detail and commenting.
<?php
// replace 'gallery' below with the name of your field
$image_ids = get_field('gallery', false, false);
// do a little test to make sure images were added
// to prevent php error
if (is_array($image_ids) && count($image_ids)) {
$shortcode = '[gallery ids="' . implode(',', $image_ids) . '"]';
echo do_shortcode( $shortcode );
}
?>
If you copy and paste that into your template where you want the carousel to appear it should work.
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.