WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
[resolved] does get_the_post_image work too for multiple thumbs? (4 posts)

  1. helgatheviking
    Member
    Posted 3 years ago #

    does the plugin work with other calls such as get_the_post_image()?

  2. bmil21
    Member
    Posted 3 years ago #

    I am also very interested in a way to use get_the_post_image() or get_the_post_thumbnail() or something similar for a secondary thumbnail.

  3. Curtiss Grymala
    Member
    Posted 3 years ago #

    There is a get_the_post_thumbnail() function built into this plug-in. Following is its usage:

    MultiPostThumbnails::get_the_post_thumbnail( $post_type, 'secondary-image', $postID, $size, $attr, $link_to_original )

    The parameters are as follows:

    • Post type - the type of post for which the thumbnail was created (you can usually just use $post->post_type for this, I think).
    • Thumbnail registration ID - the ID you assigned to this particular type of secondary image (in all of the examples that come with the plug-in, this is set to 'secondary-image', but you can set it to whatever you want).
    • Post ID - The WordPress ID of the post/page to which this image is attached (you can usually just use $post->ID for this).
    • Size - the name of the thumbnail size you want to retrieve (thumb, medium, large, original, etc.)
    • Attributes - The same as the "attr" variable used in the regular WordPress get_the_post_thumbnail() function.
    • Link to original? - Whether or not to wrap the thumbnail with a link to the original (full-sized) image.
  4. helgatheviking
    Member
    Posted 3 years ago #

    brilliant! thanks for the reply!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic