How to use first image in an article as post thumbnail (featured image)?

Posted in: Newspaper
Post count: 4

I am exporting a large number of posts to a site with a Newspaper theme. All of these posts do not have featured image as a separate field. How to use first image in an post as post thumbnail (featured image)?

Post count: 21065

Hello!

The only one solution could be to edit a post and set the image like this: https://www.screencast.com/t/hOctdrMgZTW
In our theme isn’t a setting to do this automatically for each post.
After that, make sure that you have activated the proper thumbs, in order to show the featured images properly.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh

After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/

Thank you!

Post count: 4

Okay, thank you.
So… Can you tell me a php file or place in code that generates the thumb in your theme. I want to write a function for picking up a first image from post.

Post count: 21065

Hello!

For cloud templates there are 2 files that you need to modify:
1. td-cloud-library/state/single/tdb_state_single.php [line 123] -> Here the information related to the featured image is processed.
2. td-cloud-library/shortcodes/single/tdb_single_featured_image.php -> This retrieves the processed information from above file and displays it.
For thumbnails on modules there is one file
td-composer/legacy/common/wp_booster/td_module [line 276].
Some modules use another file found in
td-cloud-library/includes/tdb_module.php [line 248].
Hope that helps you somehow!

Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.