[Resolved] Automatically Use First Image in Posts as Featured Images?

Home Forums Support [Resolved] Automatically Use First Image in Posts as Featured Images?

Home Forums Support Automatically Use First Image in Posts as Featured Images?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #130910
    John Salter

    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

    #130915
    Tom
    Lead Developer
    Lead Developer

    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;
    }
    #130933
    John Salter

    Thanks Tom,

    Where and how do I put that html code?

    #130940
    Jean Paiva
    Developer

    Hey John,

    The code above is CSS, this will help you: https://generatepress.com/knowledgebase/adding-css/

    #130945
    John Salter

    Thanks Jean, it’s getting late now. I’ll have a go tomorrow. πŸ™‚

    #131109
    John Salter

    Thanks Tom and Jean; that worked!

    #131114
    Tom
    Lead Developer
    Lead Developer

    Awesome πŸ™‚

    #570998
    Anthony

    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!

    #571056
    Leo
    Staff
    Customer Support

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

    #571825
    Anthony

    Thanks Leo – good to know – will post if come upon anything πŸ™‚

    #571864
    Leo
    Staff
    Customer Support

    Sounds good πŸ™‚

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.