My secondary thumbnail is called main-image.
I would like to return the URL of the image being used for the thumbnail to use to link to it from the thumbnail. I am not able to get get_post_thumbnail_url to return the URL.
Here is what I have tried as a starting point, but it is returning an empty href="". Any help appreciated. I also posted this to another question which suggests there might be a slightly different way to do this, I am trying two different ways, so not trying to overpost.
<?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::
$secondary_image_url = MultiPostThumbnails::get_post_thumbnail_url('POST-TYPE','main-image');
echo '<a href="' . $secondary_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" rel="lightbox" >';
the_post_thumbnail(get_post_type(), 'main-image',NULL, 'medium');
echo '</a>';
endif; ?>