Multiple Featured Images


Multiple featured images

Now compatible to PHP 5.3 again Because of various support requests I’ve established compatibility to PHP 5.3 again.

You need more than one featured image for posts, pages and/or custom post types? Then this plugin is for you!

It enables multiple featured images for all post types and comes with a widget for displaying your additional images.

IMPORTANT NOTE TO THOSE UPDATING FROM 0.3: The Plugin comes with a new method for registering featured images and updates the post meta key. It is fully backwards compatible, but if you are calling the post metas directly then please update your code accordingly. The new format of the post meta key is _kdmfi_YOUR_ID.


  1. Add as many featured images as you need
  2. Add the featured images to any post type (post, page or even custom post types)
  3. Fully customizable output – so it’s multilingual


For one of my customers I had to assign two featured images to pages. One featured image was used as the
header image and the other as a small button for the submenu. The images had to be different too (so I couldn’t
simply use different images sizes) and so I wrote this little plugin.


Feel free to ask if you have problems with this plugin. Feature requests are welcome too!


  • Admin meta box with multiple featured images.
  • Media uploader.
  • Multiple Featured Images Widget


  1. Unzip and upload the multiple-featured-images directory to the plugin directory (/wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. For registration of a new featured image please use the handy filter:

    add_filter( 'kdmfi_featured_images', function( $featured_images ) {
        $args = array(
            'id' => 'featured-image-2',
            'desc' => 'Your description here.',
            'label_name' => 'Featured Image 2',
            'label_set' => 'Set featured image 2',
            'label_remove' => 'Remove featured image 2',
            'label_use' => 'Set featured image 2',
            'post_type' => array( 'page' ),
        $featured_images[] = $args;
        return $featured_images;
  4. Display the featured image in your theme (e.g. in header.php or single.php):

    kdmfi_the_featured_image( 'featured-image-2', 'full' );


How do I register multiple new featured images?

Use the handy filter to add multiple featured images.

For expample:

    add_filter( 'kdmfi_featured_images', function( $featured_images ) {
        $args_1 = array(
            'id' => 'featured-image-2',
            'desc' => 'Your description here.',
            'label_name' => 'Featured Image 2',
            'label_set' => 'Set featured image 2',
            'label_remove' => 'Remove featured image 2',
            'label_use' => 'Set featured image 2',
            'post_type' => array( 'page' ),

        $args_2 = array(
            'id' => 'featured-image-3',
            'desc' => 'Your description here.',
            'label_name' => 'Featured Image 3',
            'label_set' => 'Set featured image 3',
            'label_remove' => 'Remove featured image 3',
            'label_use' => 'Set featured image 3',
            'post_type' => array( 'page', 'post' ),

        $featured_images[] = $args_1;
        $featured_images[] = $args_2;

        return $featured_images;
How do I use a different size of the featured image?

Simply add the size to the function call:

    kdmfi_the_featured_image( 'featured-image-2', 'full' );

You can choose every size that WordPress knows.

How can I get the ID of the featured image?

With this function call you can get the ID:

    kdmfi_get_featured_image_id( 'featured-image-2' );

Note: Since a featured image has only one individual id, there is no option ‘size’ in this function call.

How can I get the URL of the featured image?

With this function call you can get the URL:

    kdmfi_get_featured_image_src( 'featured-image-2', 'full' );
Which functions do exist?
  1. If you need the ID only, use this function:

    kdmfi_get_featured_image_id( $image_id, $post_id );

    $post_id is optional, if you leave it out, the ID of the calling post is used.

  2. To get the URL of the image:

    kdmfi_get_featured_image_src( $image_id, $size, $post_id );

    $post_id is optional (see above); $size is optional and defaults to ‘full’.

  3. To get the featured image in HTML as a string:

    kdmfi_get_the_featured_image( $image_id, $size, $post_id );

    Again, $size and $post_id are optional.

  4. To display the featured image directly:

    kdmfi_the_featured_image( $image_id, $size, $post_id ) {

    Again, $size and $post_id are optional.

  5. To check if the post has a featured image:

    kdmfi_has_featured_image( $image_id, $post_id ) {

    $post_id is optional. The function returns the id of the attachment if there’s one and false if not.


Good plugin, responsive support!

We’ve been using the plugin for a couple years now, all good. Recently, I had to contact Marcus for support due to an upgrade issue. I was very pleased with his timely response and effort to help me resolve the issue.

Read all 22 reviews

Contributors & Developers

“Multiple Featured Images” is open source software. The following people have contributed to this plugin.




  • Backwards compatibility to PHP 5.3.10
  • Added support for translations


  • Bug fixes


  • Bug fixes


  • Completely rewritten; added Widget


  • Bug fix: no output of url when a size is given


  • Code completely rewritten


  • Initial release.