voceconnect / multi-post-thumbnails

Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.
143 stars 63 forks source link

Set as a background image? #22

Closed guuthemes closed 10 years ago

guuthemes commented 10 years ago

Hi folks,

Is there anyway to set the 2nd featured image as a background image, so I can play with background-attachment, that kind of thing?

This is what I currently have -

<?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'header-image', NULL, 'header-image-full'); endif; ?>

thanks

chrisscott commented 10 years ago

Yes, you can use MultiPostThumbnails::get_post_thumbnail_url () (http://voceconnect.github.io/multi-post-thumbnails/#get-post-thumbnail-url) to get the URL to the thumbnail and use that when outputting your CSS.

guuthemes commented 10 years ago

Thanks man. Have gone back to the default method, but cheers for the swift reply.