On my homepage, the **Latest Travel Insights & Updates**

  • Hello GeneratePress Support Team,

    I need your assistance with an issue on my website using **GeneratePress Premium**, **GenerateBlocks Pro 2.6.0**, and the **Harmony Site Library** template.

    ### Issue

    On my homepage, the **Latest Travel Insights & Updates** blog section is displaying two blog posts. However, both posts always show the **same image**.

    When I edit or replace the image in one blog card, the image changes for both cards. It appears that the Query Loop is using a single static image instead of each post’s featured image.

    ### What I’ve found

    After inspecting the block structure, I noticed the Query Loop contains a standard WordPress Image block:

    `html
    <!– wp:image –>
    `

    instead of a GenerateBlocks Media block using dynamic data (Featured Image).

    As a result, the same image is repeated for every post in the Query Loop.

    ### Environment

    * GeneratePress Premium
    * GenerateBlocks Pro 2.6.0
    * Harmony Site Library
    * WordPress Block Editor (Gutenberg)

    ### My Questions

    1. How can I restore the blog section so it displays each post’s Featured Image dynamically?
    2. Is there a way to convert the current static Image block into a dynamic Featured Image block without rebuilding the entire Query Loop?
    3. If the imported Harmony template has become corrupted, is there a recommended way to restore only the blog section?

    I’ve attached screenshots showing the Query Loop and the Image block if needed.

    Thank you for your assistance.

  • Hi there,

    I have copied the query block from the Harmony template; you can paste it to your site to replace the query block in question.

    <!-- wp:generateblocks/query {"uniqueId":"8e03156e","tagName":"div","query":{"post_type":["post"],"posts_per_page":"2"}} -->
    <div><!-- wp:generateblocks/looper {"uniqueId":"29886f00","tagName":"div","styles":{"display":"grid","gridTemplateColumns":"repeat(2, minmax(0, 1fr))","columnGap":"20px","rowGap":"20px","@media (max-width:767px)":{"gridTemplateColumns":"1fr"}},"css":".gb-looper-29886f00{column-gap:20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));row-gap:20px}@media (max-width:767px){.gb-looper-29886f00{grid-template-columns:1fr}}"} -->
    <div class="gb-looper-29886f00"><!-- wp:generateblocks/loop-item {"uniqueId":"619068b5","tagName":"div","styles":{"display":"flex","flexDirection":"column"},"css":".gb-loop-item-619068b5{display:flex;flex-direction:column}","globalClasses":["gbp-card\u002d\u002dborder"]} -->
    <div class="gb-loop-item gbp-card--border gb-loop-item-619068b5"><!-- wp:generateblocks/media {"uniqueId":"26b93a24","tagName":"img","styles":{"display":"block","height":"auto","maxWidth":"100%","borderTopLeftRadius":"5px","borderTopRightRadius":"5px","borderBottomLeftRadius":"5px","borderBottomRightRadius":"5px"},"css":".gb-media-26b93a24{display:block;height:auto;max-width:100%;border-radius:5px}","htmlAttributes":{"src":"{{featured_image key:url}}","alt":"{{post_title}}"}} -->
    <img class="gb-media-26b93a24" src="{{featured_image key:url}}" alt="{{post_title}}"/>
    <!-- /wp:generateblocks/media -->
    
    <!-- wp:generateblocks/element {"uniqueId":"a2e063da","tagName":"div","styles":{"a":{"color":"var(\u002d\u002dcontrast)"},"a:hover":{"color":"var(\u002d\u002daccent)"},"display":"flex","flexDirection":"column","justifyContent":"flex-start","flexGrow":"1"},"css":".gb-element-a2e063da{display:flex;flex-direction:column;flex-grow:1;justify-content:flex-start}.gb-element-a2e063da a{color:var(\u002d\u002dcontrast)}.gb-element-a2e063da a:hover{color:var(\u002d\u002daccent)}","globalClasses":["gbp-card"]} -->
    <div class="gbp-card gb-element-a2e063da"><!-- wp:generateblocks/text {"uniqueId":"c36f1ca0","tagName":"h2","styles":{"fontSize":"1.625rem","marginBottom":"5px"},"css":".gb-text-c36f1ca0{font-size:1.625rem;margin-bottom:5px}"} -->
    <h2 class="gb-text gb-text-c36f1ca0">{{post_title link:post}}</h2>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/text {"uniqueId":"61b9bcbd","tagName":"p","styles":{"marginBottom":"2rem"},"css":".gb-text-61b9bcbd{margin-bottom:2rem}","globalClasses":["gbp-card__text"]} -->
    <p class="gb-text gbp-card__text gb-text-61b9bcbd">{{post_excerpt}}</p>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/element {"uniqueId":"816473a9","tagName":"div","styles":{"display":"flex","justifyContent":"space-between","marginTop":"auto"},"css":".gb-element-816473a9{display:flex;justify-content:space-between;margin-top:auto}"} -->
    <div class="gb-element-816473a9"><!-- wp:generateblocks/text {"uniqueId":"062db4a1","tagName":"p","globalClasses":["gbp-card__meta-text"]} -->
    <p class="gb-text gbp-card__meta-text">{{author_meta key:display_name}}</p>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/text {"uniqueId":"6cd56935","tagName":"p","globalClasses":["gbp-card__meta-text"]} -->
    <p class="gb-text gbp-card__meta-text">{{post_date}}</p>
    <!-- /wp:generateblocks/text --></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/loop-item --></div>
    <!-- /wp:generateblocks/looper -->
    
    <!-- wp:generateblocks/query-no-results -->
    <!-- wp:generateblocks/text {"uniqueId":"198a719f","tagName":"p"} -->
    <p class="gb-text">No results found.</p>
    <!-- /wp:generateblocks/text -->
    <!-- /wp:generateblocks/query-no-results --></div>
    <!-- /wp:generateblocks/query -->
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.