Closed masterjkk closed 8 years ago
This feature is broken and there has not been an update proposed. So, you cannot echo the URL alone as it stands using "get_post_thumbnail_url()". I needed a solution urgently so I did the following. It might be helpful to have a look at it but I recommend searching for a better long term solution.
<?php if (class_exists('MultiPostThumbnails')) : $thumb = wp_get_attachment_image_src(MultiPostThumbnails::get_post_thumbnail_url( get_post_type(), 'extrabg1' ), ‘thumbnail_name’) ; echo $thumb[0] ; endif; ?>
@masterjkk if you're expecting that to print the URL, you'll need to echo it. Like core's get_
vs. the_
template tags only the_
echoes the result.
@nestor-santana happy to have your reply, it works well. Thanks! I also hope the author make a bugfix about it.
@chrisscott thank you!
Closing since it doesn't seem like this is a bug but please re-open if I'm mistaken.
I use "if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), 'secondary-image'); "
but it seems to be no responding url.
why?