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


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: