WordPress – Add multiple featured images dynamically

Multiple featured images

In WordPress you can set a “featured image”. I need to add multiple featured images dynamically.

Read More

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.

Related posts

Leave a Reply

3 comments

  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.