WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Multiple Featured Images

Enables multiple featured images for posts and pages.

How do I register multiple new featured images?

You can call new kdMultipleFeaturedImages( $args ); multiple times with different arguments in $args.

For expample:

    $args1 = array(
            'id' => 'featured-image-2',
            'post_type' => 'post',      // Set this to post or page
            'labels' => array(
                'name'      => 'Featured image 2',
                'set'       => 'Set featured image 2',
                'remove'    => 'Remove featured image 2',
                'use'       => 'Use as featured image 2',
            )
    );

    $args2 = array(
            'id' => 'featured-image-3',
            'post_type' => 'post',      // Set this to post or page
            'labels' => array(
                'name'      => 'Featured image 3',
                'set'       => 'Set featured image 3',
                'remove'    => 'Remove featured image 3',
                'use'       => 'Use as featured image 3',
            )
    );

    new kdMultipleFeaturedImages( $args1 );
    new kdMultipleFeaturedImages( $args2 );

How do I use a different size of the featured image?

Simply add the size to the function call:

    kd_mfi_the_featured_image( 'featured-image-2', 'post', '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:

    kd_mfi_get_featured_image_id( 'featured-image-2', 'post' );

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:

    kd_mfi_get_featured_image_url( 'featured-image-2', 'post', 'full' );

Which functions do exist?

  1. If you need the ID only, use this function:

    kd_mfi_get_featured_image_id( $image_id, $post_type, $post_id );
    

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

  2. To get the URL of the image:

    kd_mfi_get_featured_image_url( $image_id, $post_type, $size, $post_id );
    

    $post_id is optional (see above); $size is option and defaults to 'full'.

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

    kd_mfi_get_the_featured_image( $image_id, $post_type, $size, $post_id );
    

    Again, $size and $post_id are optional.

  4. To display the featured image directly:

    kd_mfi_the_featured_image( $image_id, $post_type, $size, $post_id ) {
    

    Again, $size and $post_id are optional.

Requires: 2.9.2 or higher
Compatible up to: 3.3.2
Last Updated: 2012-5-31
Downloads: 28,258

Ratings

4 stars
4.8 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1 100,1,1
100,3,3 100,1,1
100,4,4
50,2,1
50,6,3
50,8,4
0,1,0
100,3,3
33,3,1
100,1,1
80,5,4