Use first post content image as featured image

Community Forums Forums General Discussion Use first post content image as featured image

This topic is: not resolved

This topic contains 11 replies, has 5 voices, and was last updated by  braddalton 1 year ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #78324

    dmdwebdesigns
    Participant
    Post count: 20

    I just imported another blog (wordpress.com) to my new WP website. And all my images are included in the content, there were no featured images assigned to each post.

    How can I now… get the first initial image in the content area to be used as the “featured image” without having to edit each post individually?

    Can Genesis do this? or do I need to install a plugin to tell the “featured image” area to look to the post instead?

    Thanks for your assistance in advance.

    #78339

    nutsandbolts
    Keymaster
    Post count: 3202

    You can use a function to pull the first post image as the featured post. This tutorial gives you two functions, depending on whether your child theme is one of the new HTML5 themes or an older XHTML theme: http://www.wpstuffs.com/insert-featured-image-above-posts/


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #78352

    Elisa
    Member
    Post count: 5

    This didn’t work for me, the images still didn’t show. Are there any other options?

    #78353

    nutsandbolts
    Keymaster
    Post count: 3202

    Hi Elisa,

    Can you post a link to your site and tell us a little more about your issue?


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #78361

    Elisa
    Member
    Post count: 5

    Hi,

    I’m sorry, sure.

    My site is at http://www.theunlikelyhousewife.com/

    My current featured posts all contain images, but none is showing because I haven’t gone and selected them one by one.

    I would like to tweak is so that the first image that appears in each post is automatically selected as the featured image for that post on the homepage. I have tried including the function as listed in your reply to the original poster, but the images still didn’t show. Could that be because they are not uploaded on the same server as the blog, but being remote-linked to on sites like Flickr and Photobucket?

    #78365

    dmdwebdesigns
    Participant
    Post count: 20

    Hi Nuts and Bolts… sorry this did not work for me either. I tried both sets of code. I cannot post a link as I have a Coming Soon plugin so you will not be able to see the website or the category page I am referring to.

    Any other possible suggestions?

    #78370

    dmdwebdesigns
    Participant
    Post count: 20

    I think I know what the issue is… I imported these posts and the images are NOT being put into the typical image folders. So there are no thumbnails and even if I use the regenerate thumbnails plugin, it does not find any uploaded images so it does note regenerate anything.

    When I import, if I check off the box for download file attachments, it bogs out and sends to be a “page not found”. If I import without that option, everything works but the images are not added to the media library.

    So how do I get these images into the Media Library?

    Need to figure this out…

    #78376

    dmdwebdesigns
    Participant
    Post count: 20

    Okay… this time images were added during the import. I am running the Regen. Thumbnails plugin again and this time it worked.

    Have a feeling after this is done, that the featured images will now show up as long as I have the code in the Functions.php

    I will keep you posted.

    #78386

    dmdwebdesigns
    Participant
    Post count: 20

    Sorry to say… regenerating the thumbnails and addition of the code to the functions.php file did NOT help.

    #78389

    nutsandbolts
    Keymaster
    Post count: 3202

    You may need to change “post-image” in the function to whatever your theme is using as the name for the featured image size. What child theme are you using?


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #78952

    davidzack
    Participant
    Post count: 16

    I think I’m trying to do the same thing. If a post has a Featured Image set, the thumbnail appears on the side of the teaser in the loop. But if the post does not have a featured image, I’d like the loop to use the first image in the post’s body. Can’t seem to figure out how to add that behavior.

    #78959

    braddalton
    Participant
    Post count: 10671

    If your theme is running HTML 5, it will use the first image in the post as your featured image if not added manually.

    Or you can auto set it using different methods http://wpsites.net/wordpress-tips/auto-set-featured-image/


Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.