How to pass a varibales to wordpress block markup

14 Views Asked by At

I want to pass a local image file name dynamically to a template part. I have check the internet and its very hard to find a tutorial. Can some one help me on this?

hero.html template part.

<!-- wp:image {"sizeSlug":"large"} -->
    <figure class="page-banner wp-block-image size-large">
        <img src="???" alt="Hero" />
    </figure>
<!-- /wp:image -->
0

There are 0 best solutions below