Site logo

Archived topic

Automatically Use First Image in Posts as Featured Images?

10 replies · Started by John Salter on August 20, 2015

Viewing posts 1–11 of 11

I've over 100 existing posts with images in the body of the post. I want GP to automatically pull the first image in each post to use as the featured image for that post in the blog masonary and categories, etc.

But without adding another copy of the image above the existing, as happens when I try to do it manually with the featured image widget on the rhs of the wp dashboard.

How can I do this?

John

Hi John,

You could try a plugin like this: https://wordpress.org/plugins/set-all-first-images-as-featured/

There's also a lot of functions out there if you search for "WordPress set first image as featured".

Then to stop the image from being shown twice on your single posts, you can hide the featured image so it shows the content one only:

.single .page-header-image-single {
      display: none;
}

Thanks Tom,

Where and how do I put that html code?

Thanks Jean, it's getting late now. I'll have a go tomorrow. :)

Thanks Tom and Jean; that worked!

Awesome :)

Sorry to bring up an old thread ...

Same boat .... have hundreds of posting that do not have featured image set.

Anything newer anyone has come across with auto-populating featured image from existing image in post?

Before downloading old plugins (not found in repo anymore), wanted to reach out.

Super thank you!

Unfortunately I don't think there are any new solutions for this.

Thanks Leo - good to know - will post if come upon anything :)

Sounds good :)

This archived topic is closed to new replies.