how do I change the image preview of a blog post?

This is the right place to report general bugs, make suggestions or ask for help.
Docthib
Posts: 12
Joined: Fri May 08, 2026 1:37 pm

how do I change the image preview of a blog post?

Post by Docthib » Sat Aug 08, 2026 3:12 pm

Dear all,
thanks for FlatPress and the great support! ;)
Here is my question of the trimester: how do I change the image preview of a blog post?
Let me elaborate:
  • For any blog post, I copy and paste the link to (for example) Linkedin
  • Then Linkedin automatically displays always the same picture i.e. the generic preview of the theme. This is the same when I post a link to Signal: it is the generic theme picture that is always displayed.
  • How can I choose to display the first picture within the blog post as an illustration, or ideally, choose between all the pictures within the blog post?
  • Any comment appreciated: though I am no programmer, you can suggest the template file and the code that I should tweak (if any)
(I searched for "preview" in the forum, to no avail, but maybe this is not the right word for what I am describing)
Sincerely,
Docthib

Docthib
Posts: 12
Joined: Fri May 08, 2026 1:37 pm

Re: how do I change the image preview of a blog post?

Post by Docthib » Tue Aug 11, 2026 10:21 am

Dear all,
I am replying to myself. Problem not solved, but progress made, so I document my thoughts here, if that can help anyone with the same problem. Here is my procedure:
  • Create a new blog entry
  • Put a picture in the entry, and some text
  • Select "entry cover" with the appropriate file (= the file of the same picture in the media manager)
  • Publish it
  • I can see it as a new blog entry on my blog
  • I then copy the link of this entry and paste it into a Linkedin post (or a Signal message) → Linkedin retrieves a preview picture that is always the generic picture of the Leggero Theme, and not my cover entry picture.
Any thoughts or ideas appreciated. I suppose that the Entry Cover plugin is not the right one to answer my needs, or maybe I am not doing the right thing...

Sincerely,
Docthib

User avatar
fraenkiman
FlatPress Coder
Posts: 536
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: how do I change the image preview of a blog post?

Post by fraenkiman » Thu Aug 13, 2026 7:27 pm

Hello Docthib,

The “static” preview image of the theme/style is passed through by the SEO Metatag Info plugin.
In HTML code:
Screenshot 2026-08-13 210419.png
Screenshot 2026-08-13 210419.png (49.4 KiB) Viewed 362 times
In PHP code:
Screenshot 2026-08-13 210957.png
Screenshot 2026-08-13 210957.png (68.77 KiB) Viewed 362 times
If you set the SEOMETA_GEN_IMAGE_META constant to “false,” the theme/style preview will no longer be passed through.
Screenshot 2026-08-13 211549.png
Screenshot 2026-08-13 211549.png (16.14 KiB) Viewed 362 times

Currently, there is no plugin that passes an image via Open Graph to social media for each post.

Best regards,
Frank

Docthib
Posts: 12
Joined: Fri May 08, 2026 1:37 pm

Re: how do I change the image preview of a blog post?

Post by Docthib » Fri Aug 14, 2026 5:49 am

Code: Select all

Currently, there is no plugin that passes an image via Open Graph to social media for each post.
OK, thanks for the update and the information!
I will try to find a quick and dirty workaround (if I manage to think about one), or I will let it rip... :D
Sincerely,
Docthib

User avatar
fraenkiman
FlatPress Coder
Posts: 536
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: how do I change the image preview of a blog post?

Post by fraenkiman » Fri Aug 14, 2026 4:29 pm

Hi Docthib,

I’d like to ask you to run a few tests:
1. Create a backup of the SEO Mata Tag plugin and the Readmore plugin; or of the entire FlatPress instance.
2. Please copy the patched files into your FlatPress instance.
3. Check whether the behavior works as expected.

SEO-Metatag-Info_dynamic-OG-Image_v1.0.zip
(23.13 KiB) Downloaded 16 times
A prerequisite is an installed FlatPress 1.5.1 Stringendo instance.

The implemented logic accounts for the following cases:
1. If multiple posts are displayed in the post stream with images, the first image (not the thumbnail) should be distributed via Open Graph.
2. If multiple posts are displayed in the post stream with one or more galleries, the first image in the gallery (not the thumbnail) should be distributed via Open Graph.
3. If a single post is displayed with one or more images, the first image (not the thumbnail) should be distributed via Open Graph.
4. If a single post is displayed with one or more galleries, the first image in the gallery (not the thumbnail) should be distributed via Open Graph.
5. When a static page with one or more images is displayed, the first image (not the preview) should be shared via Open Graph.
6. When a static page with one or more galleries is displayed, the first image (not the preview) should be shared via Open Graph.

If there is a problem, I need at least the following information:
1. A brief, concise description of the issue
2. What your expectations are
3. The raw text from the post editor or static page editor.

If the behavior is as expected, please provide brief feedback.

Best regards,
Frank

User avatar
fraenkiman
FlatPress Coder
Posts: 536
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: how do I change the image preview of a blog post?

Post by fraenkiman » Fri Aug 14, 2026 9:46 pm

Here is an update on this feature.

SEO-Metatag-Info_dynamic-OG-Image_v1.1.zip
(77.17 KiB) Downloaded 14 times
In this update, images are distributed via Open Graph in the social media-friendly aspect ratio of 1.91:1.

Best regards,
Frank

User avatar
fraenkiman
FlatPress Coder
Posts: 536
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: how do I change the image preview of a blog post?

Post by fraenkiman » Sat Aug 15, 2026 4:34 pm

Here is the latest update to this feature.

og:image:alt is derived from the optional image title (title attribute).

SEO-Metatag-Info_dynamic-OG-Image_v1.2.zip
(81.19 KiB) Downloaded 18 times

For individual images, you can optionally enter the following in the editor:

Code: Select all

[img=images/a.png width="320" float="right" title="Image title"]
The SEO Metatag Info plugin generates the following from this:

Code: Select all

<meta property="og:image:alt" content="Image title">
If no title is specified, the title defaults to the title of the FlatPress blog.

The process is similar for gallery images. However, the SEO Metatag Info plugin generates the image title from the image title specified in the Gallery Captions plugin. The fallback here is also the title of the FlatPress blog.

I’ve also implemented this feature in the FlatPress project blog.
This ensures that every post linked on social media includes the first image from the post with the appropriate image title.

I think we can merge this feature into the master branch for FlatPress 1.6.

Have a relaxing weekend, and best regards,
Frank

Docthib
Posts: 12
Joined: Fri May 08, 2026 1:37 pm

Re: how do I change the image preview of a blog post?

Post by Docthib » Sun Aug 16, 2026 8:23 am

Thank you very much, Fraenkiman !
From what I undertand, you have re-written the plugin SEO meta tag: much appreciated! :)
I am currently making a whole backup of the blog, and then I will proceed with the rest of the steps, and keep you posted.
Excellent week-end to you,
Sincerely,
Docthib

Docthib
Posts: 12
Joined: Fri May 08, 2026 1:37 pm

Re: how do I change the image preview of a blog post?

Post by Docthib » Sun Aug 16, 2026 5:08 pm

Dear Frank,
thanks for the plugins.
TLDR: I cannot access anymore admin.php or the welcome page of the blog.

Here are the details:
fraenkiman wrote: Fri Aug 14, 2026 4:29 pm 1. Create a backup of the SEO Mata Tag plugin and the Readmore plugin; or of the entire FlatPress instance.
2. Please copy the patched files into your FlatPress instance.
3. Check whether the behavior works as expected.
Done steps:
  • (entire backup),
  • by FTP, deleted "old" plugins and replaced them with the new ones (from SEO-Metatag-Info_dynamic-OG-Image_v1.2.zip),
  • → blog does not appear anymore, neither with /admin.php nor with the public address of the blog.
The error message with /admin.php is

Code: Select all

Warning: require(inc/hw-helpers.php): Failed to open stream: Aucun fichier ou dossier de ce type in /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-plugins/seometataginfo/plugin.seometataginfo.php on line 12

Fatal error: Uncaught Error: Failed opening required 'inc/hw-helpers.php' (include_path='/home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/') in /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-plugins/seometataginfo/plugin.seometataginfo.php:12 Stack trace: #0 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.plugins.php(164): include_once() #1 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.plugins.php(79): plugin_load('seometataginfo', false) #2 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.plugins.php(105): plugin_indexer->getEnableds(false) #3 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.system.php(203): plugin_loadall() #4 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/admin/main.php(217): system_init() #5 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/admin.php(342): require('/home/clients/7...') #6 {main} thrown in /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-plugins/seometataginfo/plugin.seometataginfo.php on line 12
The error message with the public address of the blog is:

Code: Select all

Warning: require(inc/hw-helpers.php): Failed to open stream: Aucun fichier ou dossier de ce type in /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-plugins/seometataginfo/plugin.seometataginfo.php on line 12

Fatal error: Uncaught Error: Failed opening required 'inc/hw-helpers.php' (include_path='/home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/') in /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-plugins/seometataginfo/plugin.seometataginfo.php:12 Stack trace: #0 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.plugins.php(164): include_once() #1 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.plugins.php(79): plugin_load('seometataginfo', false) #2 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.plugins.php(105): plugin_indexer->getEnableds(false) #3 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-includes/core/core.system.php(203): plugin_loadall() #4 /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/index.php(243): system_init() #5 {main} thrown in /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-plugins/seometataginfo/plugin.seometataginfo.php on line 12

I have reverted to the initial versions of seometatag and readmore, and the admin and the blog are back again.

Hope the error messages help.

Sincerely,
Docthib
Last edited by fraenkiman on Sun Aug 16, 2026 7:33 pm, edited 1 time in total.
Reason: I've put the error log in a code block. It's easier to read that way.

User avatar
fraenkiman
FlatPress Coder
Posts: 536
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: how do I change the image preview of a blog post?

Post by fraenkiman » Sun Aug 16, 2026 6:32 pm

Docthib wrote: Sun Aug 16, 2026 5:08 pm [*] by FTP, deleted "old" plugins and replaced them with the new ones (from SEO-Metatag-Info_dynamic-OG-Image_v1.2.zip),


Fatal error: Uncaught Error: Failed opening required 'inc/hw-helpers.php' (include_path='/home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/') in /home/clients/76edbb66b4de0df9eeb77953b4ce98cf/web/blogthib-flat/fp-plugins/seometataginfo/plugin.seometataginfo.php:12 Stack trace: #0
plugin.seometataginfo.php cannot find the file hw-helpers.php in fp-plugins/seometataginfo/inc/.

You may have deleted too much beforehand. It is not necessary to delete anything beforehand. A backup is sufficient. Once the backup is created, simply replace the existing files with the files from the ZIP archive.

Should I create a complete plugin archive for you, just to be safe, instead of just the patched files?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests