1

Multiple featured images

In Wordpress you can set a "featured image". I need to add multiple featured images dynamically.

Dynamically number of featured images

When I say dynamically I mean, for one post I might want 2 images and for the next one 6 featured images. The number is unknown.

Just loop them out, when done

When in the theme I just loop them out with a foreach loop. Featured images are stored as custom fields. This part I can handle.

A plugin might do it?

I know of http://wordpress.org/extend/plugins/multiple-post-thumbnails/ but here I need to deside the number of images from the start. My number is unknown.

Plugin, script or good articles are welcome.

3 Answers 3

6

I recently added a plugin to a wordpress plugin repository which simulates the need of dynamic multiple featured image. You can check it out here.

enter image description here

Any suggestion, pull requests, issues, and plugin recommendations are more than welcome! Interested can join the development at GitHub.

2

The answer was to use Advanced Custom Fields. It's very powerful plugin for adding custom fields of all kinds.

The addon "Repeater" did the trick.

1

Depending on how you're planning to use your featured images, you might be able to just add them as a gallery to your post/page. Then, you could use one of these snippets to access your gallery images on your listing and detail pages:

Snippet 1

Snippet 2

The biggest drawback to this method is that they aren't featured images by the strict WordPress definition, so any themes or functions that are depending on them won't exactly work right.

1
  • Not exactly what I'm looking for. However, I've started a remake of this code to a plugin acousticwebdesign.net/web-design/…. It allows me to add one thumbnail. My modified version will allow unlimited numbers. Dec 8, 2011 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.