I'm trying to define the image I took from a remote site as a featured image, but I can't do it. I tried 2 different methods below but neither of them worked. How can I do it, can you help me?
Method 1 - doesn't work:
$postmeta->meta_value = $postmeta->meta_value.$imagelink;
update_post_meta($postmeta);
Method 2 - doesn't work:
update_post_meta(['post_id' => $post_id, 'meta_value' => $imagelink]);
I don't know if it's done differently. My goal is to add the image from the other site to the topic on my own site as a featured image.
I would like to add. there are topics on my site. The topics do not have featured images. So I guess I need to update and add it.