WordPress: get_the_post_thumbnail_url by id defined in value of custom field

i am trying to accomplish to get_the_post_thumbnail_url by a post-id defined in a custom field. Something like this:

<?php $url = get_the_post_thumbnail_url( 'the_field('portfolio_similar_project_1')', 'thumbnail' ); ?>
<img src="<?php echo $url ?>" />

This works:

<?php $url = get_the_post_thumbnail_url( 53, 'thumbnail' ); ?>
<img src="<?php echo $url ?>" />

Any ideas? Thanks

Read more here: WordPress: get_the_post_thumbnail_url by id defined in value of custom field

Leave a Reply

Your email address will not be published. Required fields are marked *