Open aaronfc opened 2 years ago
I've been looking into this and there are currently a few issues I found with featured image
options:
Block Themes | Course | Lesson |
---|---|---|
Single Page Show | ✅ (but not custom size) | ✅ (but double image) |
Archive Show* | ❌ | ❌ |
Single Page Hide | ✅ | ✅ |
Archive Hide** | ❌ | ❌ |
PHP Template Themes | Course | Lesson |
---|---|---|
Single Page Show | ✅ (but not custom size) | ✅ (but double image) |
Archive Show* | ❌ | ❌ |
Single Page Hide | ❌ | ❌ |
Archive Hide** | ❌ | ❌ |
*The Archive featured image
display option was moved to the block metabox, so the Settings option doesn't work.
** Currently there is no option to show/hide Lesson images on the Course Page.
Example double featured image (blockbase theme):
The problem is that Sensei is trying to output inside a template using a hook, but Sensei sometimes uses PHP templates and other times uses Blocks. In the Lesson example, the reason there's a double output is that one is the theme outputting it in the header and the second one is Sensei outputting it in the sensei_single_lesson_content_inside_before
hook.
Are we trying to support both php template use and block use?
My proposal:
featured_image
either shows/hides depending on the site settings. We would hook into post_thumbnail_html
and post_thumbnail_size
to show/hide and change the image sizes.@aaronfc what do you think?
Reported by Gonzalo here: p1654590027797169-slack-C03BXN7UQ5V
Reproduce:
Extra info: