• Hi WordPress community,

    I’m running into a design limitation in the Template Editor and Pattern Editor: the resolution options (thumbnail, medium, large, full size) for the Featured Image block are completely missing when the block is used outside a Query Loop block.

    Steps to Reproduce:

    1. Open the Template Editor (e.g., for a single post template) or Pattern Editor.
    2. Add a Featured Image block to your layout (e.g., in a header, hero section, or standalone area).
    3. Open the block settings to adjust the image resolution.
    4. Result: The resolution dropdown is entirely absent from the settings panel.

    Expected Behavior: The resolution options should be available for any Featured Image block, regardless of its placement, to ensure full control over image display.

    Why This Is Problematic:

    • It disrupts the workflow for designers and developers who need to create reusable patterns or custom templates with precise image dimensions.

    Question: Is this a known issue, a missing feature, or an intentional design choice? If intentional, what’s the reasoning behind removing resolution options outside a Query Loop?

    Environment:

    • WordPress: 6.9+
    • Theme: Twenty Twenty-Five
    • Editor: Gutenberg (Template/Pattern Editor)

    Additional Context: This issue appears to affect all block themes and is particularly frustrating when working with reusable patterns or custom templates.

    Has anyone found a workaround, a plugin, or a code snippet to restore these options? Or is there a way to override this behavior via theme.json or filters?

    Thanks for your help!

    Julien

Viewing 1 replies (of 1 total)
  • Thread Starter Ju’Z[ed]

    (@juzed)

    pouyawebio wrote:

    This is actually expected behavior, not a bug.

    The Featured Image block only exposes resolution controls when it has a post context (like inside a Query Loop). Outside of a Query block, WordPress treats it as a dynamic image without a specific post instance, so the size selector is intentionally hidden.

    In other words:

     - Inside Query Loop → post context exists → sizes available

     - Outside Query → no fixed post → sizes removed

    Workarounds:

     - Wrap the Featured Image inside a Query Loop (even with 1 post)

     - Use a normal Image block instead if you need fixed sizing

     - Control dimensions via CSS (width/height/object-fit)

     - Advanced: you can set sizes in theme.json or filter render_block_core/post-featured-image

    So this is more of a design limitation of Gutenberg rather than a missing feature.

    Thank you for the detailed explanation. I now understand the design intent behind this behavior.

    In my specific case, the pattern containing the Featured Image block is used within a custom Query Loop. Users can create their own patterns and assign them to each post type displayed in the query. However, even in this context, the resolution options remain unavailable for the Featured Image block when it’s placed inside a pattern—despite the pattern being used within a Query Loop.

    I attempted to programmatically add post context using the render_block_context filter, but it didn’t resolve my issue:

    add_filter('render_block_context', function ($context, $parsed_block) {
    if ($parsed_block['blockName'] === 'core/post-featured-image') {
    $context = [
    'postId' => 1,
    'postType' => 'post',
    ];
    }
    return $context;
    }, PHP_INT_MAX, 2);

    Is there a way to ensure the Featured Image block recognizes the post context when used inside a pattern within a custom Query Loop? Alternatively, are there other filters, hooks, or methods to restore the resolution options in this scenario?

    If this isn’t currently possible, are there plans to address this limitation in future WordPress updates? It would significantly enhance flexibility for developers and designers working with reusable patterns and custom Query Loops.

    Thanks again for your help!

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.