WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Featured Images
Using if has_post_thumbnail with multiple featured images (4 posts)

  1. andyhoyland
    Member
    Posted 2 years ago #

    Hi there.

    I'm trying to set this plugin to display specific featured images if it has them and then fall back to the default featured image if it doesn't.

    Is there something along the lines of kd_mfi_has_featured_image that would let me do this?

    Many thanks.
    Andy

    http://wordpress.org/extend/plugins/multiple-featured-images/

  2. marcus.kober
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Andy,

    there's currently nothing like a fall back yet. But it would be a good feature for the next release!

    You have to code it for yourself. Try to retrieve the ID of the featured image with kd_mfi_get_featured_image_id( 'featured-image-2', 'post' ); and if it returns nothing, than output the fall back.

    If I have the time I will update the plugin and give it a has_image feature. Perhaps there will be a fall back option too. Like this:

    kd_mfi_the_featured_image( 'featured-image-2', 'post', 'full', $fallback );

    $fallback could be:

    $fallback = '<img src="/path/file.jpg" />';

    Look out for a new version next week! ;)

    Regards,
    Marcs

  3. andyhoyland
    Member
    Posted 2 years ago #

    Thanks Marcus - and for the speedy response.

    I think I've cobbled something together - I'll post it up when it's tidy! And I'll keep a look out for the new version!

    Many thanks.
    Andy

  4. lupi73
    Member
    Posted 2 years ago #

    Hello,
    An example??? What looks like this plugin activate???
    thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic