Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Captions for thumbnail navigation in Flexslider

Hi there,

So I enabled the thumbnail navigation on my Flexslider with the

jQuery(document).ready(function($) {
$('.flexslider').flexslider({

    controlNav: "thumbnails",

    });
});

Then adding the attribute

<li data-thumb="<?php the_field( 'homepage_slider_image' ); ?>

This gets the thumbnails showing up fine, but they're being automatically generated by flexslider.

I was wondering if anyone knew how you might add captions to the thumbnails? I cant seem to find anything in the flexslider documentation.

Thanks in advance!

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

I think you're going to have to do this custom. However you are generating your list of images for your slider, you should be able to have some sort of field, meta box, or excerpt box that would allow you to type in your caption, and than your HTML add the additional HTML with the correct PHP scripts to pull in the unique caption for that image, and than format that caption in your CSS.

That should work.