• First of all, let me tell you that I already tried all existent plug-ins to do that (post thumbnail/featured image generators) and NONE of them worked. A dozen, about.

    Now, I have about 1.500 posts containing <img> elements (inline images). All images are ALREADY uploaded in media library, that is, all elements are like this one

    <img ... src="http://www.mysite.com/wp/wp-content/uploads/year/mm/image.png"

    However, no image is really attached to posts and 90% of posts have no featured image, only inline images. So I need to execute ONCE (forever) some code to parse posts and, if there is an <img> element, to set the corresponding image (surely already in media library) as featured image, unless there is already a featured image.

    I tried myself some code but the only mechanism I found was a hook to save_post that forces me to manually update each post (real edit, because for some reason the hook is NOT called by quick or bulk edit).

    Any help appreciated.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Set featured image from first IMG element in post’ is closed to new replies.