WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
[resolved] Get plain text src attribute using MultiplePostThumbnails? (3 posts)

  1. zackperdue
    Member
    Posted 3 years ago #

    is there a way i can get the plain src for the image? I would like to use the src for other things instead of output an entire image tag.

    Let me know if this is possible and how.

    Thanks in advance,

    Zack

  2. Alex
    Member
    Posted 3 years ago #

    I was able to get src using the following code (in my case portfolio post type and sull-site thumbnail ID)

    <?php if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail('portfolio', 'full-site')) {
    
    		$sec_img = MultiPostThumbnails::get_post_thumbnail_id('portfolio', 'full-site', $post->ID);
    		echo wp_get_attachment_url($sec_img);
    
    	}  ?>
  3. zackperdue
    Member
    Posted 3 years ago #

    Thanks for responding,

    I believe the solution i came up with was pretty close to this.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic