Closed s3w47m88 closed 7 years ago
Can you share the code you are using to do this?
I don't have the code anymore, but I was trying to use get_the_post_thumbnail_url to wrap:
<?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail( get_post_type(), 'secondary-image' ); endif; ?>
So that I could extract the URL instead of getting the whole Object. But it simply didn't work. I believed this because get_the_post_thumbnail
worked, but get_the_post_thumbnail_url
did not. And I think that's because they require different arguments, that latter requiring arguments that the above Class and Function don't pass, thus making it impossible to get the URL using that Function.
Does that make sense?
Thanks for your time!
The first 4 args of get_post_thumbnail_url() are the same as the_post_thumbnail() so it should have worked.
Hi, I am trying to get just the URL but when I use get_the_post_thumbnail_url I get an error. Any thoughts? Thanks!