Hi Johan,
The fallback image is mostly used in preview.php (on archive pages) and in the recent posts widget. It’s not used for the main image on singular pages, since I thought most people wouldn’t want to display a fallback image in that space.
I didn’t think it was possible to filter the image output in the block editor content, but it turns out it is, so the posts block will get support for the fallback images in the next version of Chaplin.
– Anders
Hi @jonkastonka,
This was added not long after I posted, and it’s working (for the posts block) for me when running the latest version of Chaplin and WordPress. I didn’t add it for the cover block.
— Anders
I’m using the posts block as well but it’s not working. Or am I misunderstanding how it’s supposed to work.
Screenshots:
- Customizer
- Admin page with post block
- Front end
Ah. The fallback image only shows up in the Latest Posts block for posts other than the current one, since the conditionals try to prevent the fallback from being used for the main entry image area. I’ve updated the conditionals in version 2.6.7 to make sure that the fallback shows up for the current post as well.
Ok, it works on native block “Latest Posts” but not on the block “Posts” from CoBlocks, which is the one I’m using. Maybe that isn’t possible to hook on to from a theme level.
@jonkastonka Yeah, it’s entirely possible that the CoBlocks block doesn’t use has_post_thumbnail() and the post_thumbnail_html filter, so there’s no way to filter the result before it’s output.