Forums

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

  1. zackperdue
    Member
    Posted 11 months 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. netxm
    Member
    Posted 9 months 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 9 months ago #

    Thanks for responding,

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

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic