Recently I changed some code that had an empty value in the post ID. That made the function unable to set a featured image in the current post. What ended up happening was the most recent image got set as the featured post for EVERY POST, on EVERY update. Oops.
Here is a snippet to fix the problem:
Not sure what happened to the code…
Oh, I had a very similar issue a few months ago. This would do the same trick, very quick:
Oh, I had a very similar issue a few months ago. This would do the same trick, very quick:
and adding:
to the last SELECT will do this only if the post doesn’t have a featured image already.
Thanks, this saved my life!
Thanks,
I’m facing the same problem.
i need this code more than anything…
I just transferred my blog and have an problem. My images are not showing up in the posts and my featured image is not showing up. I have tried fixes,plugins is there a code I can use or a plugin that will fix the problem. Thanks