Replace featured image with slider with attached images


I would like to use the sparkling theme for our travelling blog and I have installed sparkling child theme.
I would like to replace the featured image from a single blog post with a slider (e.g. flexslider) which shows all attached images. I’ve been trying to do so all afternoon, but I wasn’t succesful. Is it possible to provide some sample code?

Many thanks.


This is request for custom development as it requires a lot of time to be implemented.

Some tips that you should take into consideration:

  1. Flexslider related CSS and Javascript by default is loaded only on front page / home page and this needs to be addressed if you are looking to enable it globally.

  2. Flexslider, when enabled, targets only one class - .flexslider which is defined via flexslider-custom.js. For multiple slider you might want to target different classes or at least know what you are targeting.

  3. Now you need to get those post attachments and style them properly because flexslider requires special markup (most of the sliders require the same but just chunch of images won’t do it.) For basic idea from WordPress side you can look here. And here for Flexslider specific markup.

Now you should put it all together and style it properly.

Sorry that I can’t help you with complete code but I hope that you got at least some idea about this.

Hello Aigars,

Thanks for the provided information. With your tips I was able to implement a slider with the attached images on the single post page!

Thanks a lot,