https://developer.ww.wp.xz.cn/reference/functions/get_the_post_thumbnail/
if you know the post ID of the other page/post, for example:
<php echo get_the_post_thumbnail( $post_ID ); ?>
Thanks, that’s not quite what I need.. or maybe it is and I’m being stupid :p
Basically, I need the code in order to retrieve the URL of the featured image on a certain page. So I’m no good with PHP commands but let me set out what the PHP command would look like that I’m trying to create:
Get featured image URL of Post ID = 110
So in theory a PHP command like that should return the URL directly to image post 110.
Can that be done?
Thanks 🙂
https://codex.ww.wp.xz.cn/Function_Reference/get_post_thumbnail_id
https://codex.ww.wp.xz.cn/Function_Reference/wp_get_attachment_image_src
Get featured image URL of Post ID = 110
example:
<?php
$post_ID = 110;
$featured = wp_get_attachment_image_src( get_post_thumbnail_id( $post_ID ) );
$featured_url = $featured[0];
?>