Support » Plugin: Multiple Post Thumbnails » [Plugin: Multiple Post Thumbnails] Exclude secondary featured image

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chris Scott

    (@chrisscott)

    You can use MultiplePostThumbnails::get_post_thumbnail_id('post', 'secondary-thumb', $post_id) to get the post thumbnail ID for the given post type, thumbnail ID, and post ID.

    I was able to accomplish this with the following code:

    <?php
      $featuredA = get_post_thumbnail_id($post->ID); /* first thumbnail */
      $featuredB = MultiPostThumbnails::get_post_thumbnail_id('CUSTOM_POST_TYPE', 'SECONDARY_THUMB_NAME', $post->ID); /* second thumbnail */
      echo do_shortcode('[gallery exclude="'.$featuredA.','.$featuredB.'"]');
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Multiple Post Thumbnails] Exclude secondary featured image’ is closed to new replies.