Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Making the homepage of “Lens” template show single post, not list of posts

  • Hello.
    I am using the “Lens” template from the Site Library.
    How do I make the front page display a single (latest) post (https://capyneko.com/2025/05/20/hello-world/) instead of the list of the posts?
    Thank you.

  • Hi there,

    I can’t see your site; it seems to have a site lock that requires another set of user/password.

    The Lens homepage does not have a list of posts, do you want to add the latest post content on the right side?

    Is this what you want?https://app.screencast.com/SuIwguBwzTRcn

    If not, can you let me know what kind of layout you are thinking of?

  • Sorry about that. I removed the password.
    I was hoping to make the home page be the latest blog post, like this:
    https://imgur.com/a/0iECI3i

  • Try following the steps below:

    1. Add a new page, and go to settings > reading, choose this page as your front page.

    2. Create a new block element – loop template, set the location to front page.

    3. Paste this code into the new element:

    <!-- wp:generateblocks/query {"uniqueId":"e4446401","tagName":"div","query":{"post_type":["post"],"posts_per_page":"1"}} -->
    <div><!-- wp:generateblocks/looper {"uniqueId":"467fdbd6","tagName":"div"} -->
    <div><!-- wp:generateblocks/loop-item {"uniqueId":"f70e2bfb","tagName":"div"} -->
    <div class="gb-loop-item"><!-- wp:generateblocks/element {"uniqueId":"e54da032","tagName":"div","styles":{"@media (max-width:1024px)":{"flexDirection":"column"},"display":"flex","position":"sticky","top":"0px"},"css":".gb-element-e54da032{display:flex;position:sticky;top:0px}@media (max-width:1024px){.gb-element-e54da032{flex-direction:column}}","htmlAttributes":{},"metadata":{}} -->
    <div class="gb-element-e54da032"><!-- wp:generateblocks/element {"uniqueId":"59b088d5","tagName":"div","styles":{"@media (max-width:1024px)":{"height":"unset","minHeight":"600px"},"backgroundColor":"var(\u002d\u002dcontrast)","color":"var(\u002d\u002dbase-2)","display":"flex","flexDirection":"column","justifyContent":"center","position":"sticky","overflowX":"hidden","overflowY":"hidden","flexGrow":"1","flexShrink":"1","flexBasis":"50%","height":"100vh","backgroundImage":"var(\u002d\u002dinline-bg-image)","backgroundSize":"cover","backgroundRepeat":"no-repeat","backgroundPosition":"center","backgroundBlendMode":"normal","@media (max-width:767px)":{"minHeight":"400px"},"top":"0px"},"css":".gb-element-59b088d5{background-blend-mode:normal;background-color:var(\u002d\u002dcontrast);background-image:var(\u002d\u002dinline-bg-image);background-position:center;background-repeat:no-repeat;background-size:cover;color:var(\u002d\u002dbase-2);display:flex;flex-basis:50%;flex-direction:column;flex-grow:1;flex-shrink:1;height:100vh;justify-content:center;overflow-x:hidden;overflow-y:hidden;position:sticky;top:0px}@media (max-width:1024px){.gb-element-59b088d5{height:unset;min-height:600px}}@media (max-width:767px){.gb-element-59b088d5{min-height:400px}}","htmlAttributes":{"style":"\u002d\u002dinline-bg-image: url({{featured_image key:url}})"},"metadata":{},"className":"sticky"} -->
    <div class="gb-element-59b088d5 sticky" style="--inline-bg-image: url({{featured_image key:url}})"><!-- wp:generateblocks/element {"uniqueId":"820ea7a1","tagName":"div","styles":{"@media (max-width:767px)":{"flexDirection":"row","rowGap":"80px","justifyContent":"space-between","alignItems":"flex-end"},"\u0026:is(:hover, :focus)":{"color":"var(\u002d\u002dbase-3)"},"color":"var(\u002d\u002dbase)","display":"flex","justifyContent":"space-between","position":"relative","paddingTop":"0px","paddingRight":"20px","paddingBottom":"0px","paddingLeft":"20px","a":{"color":"var(\u002d\u002dbase-3)"},"width":"100%","height":"100%","alignItems":"center","backgroundColor":"rgba(33, 33, 33, 0.5)","columnGap":"40px","@media (max-width:1024px)":{"flexGrow":"1"}},"css":".gb-element-820ea7a1{align-items:center;background-color:rgba(33,33,33,0.5);color:var(\u002d\u002dbase);column-gap:40px;display:flex;height:100%;justify-content:space-between;position:relative;width:100%;padding:0px 20px}.gb-element-820ea7a1:is(:hover,:focus){color:var(\u002d\u002dbase-3)}.gb-element-820ea7a1 a{color:var(\u002d\u002dbase-3)}@media (max-width:1024px){.gb-element-820ea7a1{flex-grow:1}}@media (max-width:767px){.gb-element-820ea7a1{align-items:flex-end;flex-direction:row;justify-content:space-between;row-gap:80px}}","htmlAttributes":{},"metadata":{},"className":"custom-post-navigation"} -->
    <div class="gb-element-820ea7a1 custom-post-navigation"><!-- wp:generateblocks/element {"uniqueId":"125fe0d3","tagName":"div","styles":{"display":"flex","flexDirection":"column","alignItems":"flex-start","flexGrow":"1","flexShrink":"1","flexBasis":"0px"},"css":".gb-element-125fe0d3{align-items:flex-start;display:flex;flex-basis:0px;flex-direction:column;flex-grow:1;flex-shrink:1}"} -->
    <div class="gb-element-125fe0d3"><!-- wp:generateblocks/text {"uniqueId":"5d4b34be","tagName":"a","styles":{"display":"inline-flex","alignItems":"center","columnGap":"0.5em","fontSize":"12px","marginBottom":"10px",".gb-shape svg":{"width":"1em","height":"1em","fill":"var(\u002d\u002dbase-3)"},"textDecoration":"none"},"css":".gb-text-5d4b34be{align-items:center;column-gap:0.5em;display:inline-flex;font-size:12px;margin-bottom:10px;text-decoration:none}.gb-text-5d4b34be .gb-shape svg{width:1em;height:1em;fill:var(\u002d\u002dbase-3)}","htmlAttributes":{"href":"{{post_permalink source:previous-post}}"},"metadata":{}} -->
    <a class="gb-text-5d4b34be" href="{{post_permalink source:previous-post}}"><span class="gb-shape"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"></path></svg></span><span class="gb-text">PREVIOUS</span></a>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/text {"uniqueId":"ada67ae6","tagName":"a","styles":{"display":"inline-flex","alignItems":"center","columnGap":"0.5em","fontSize":"20px","marginBottom":"10px",".gb-shape svg":{"width":"1em","height":"1em","fill":"var(\u002d\u002dbase-3)"},"textDecoration":"none"},"css":".gb-text-ada67ae6{align-items:center;column-gap:0.5em;display:inline-flex;font-size:20px;margin-bottom:10px;text-decoration:none}.gb-text-ada67ae6 .gb-shape svg{width:1em;height:1em;fill:var(\u002d\u002dbase-3)}","htmlAttributes":{"href":"{{post_permalink source:previous-post}}"},"metadata":{},"className":"hide-on-mobile"} -->
    <a class="gb-text gb-text-ada67ae6 hide-on-mobile" href="{{post_permalink source:previous-post}}">{{post_title source:previous-post}}</a>
    <!-- /wp:generateblocks/text --></div>
    <!-- /wp:generateblocks/element -->
    
    <!-- wp:generateblocks/element {"uniqueId":"fd48929a","tagName":"div","styles":{"display":"flex","flexDirection":"column","alignItems":"flex-end","flexGrow":"1","flexShrink":"1","flexBasis":"0px"},"css":".gb-element-fd48929a{align-items:flex-end;display:flex;flex-basis:0px;flex-direction:column;flex-grow:1;flex-shrink:1}"} -->
    <div class="gb-element-fd48929a"><!-- wp:generateblocks/text {"uniqueId":"b4501721","tagName":"a","styles":{"display":"inline-flex","alignItems":"center","columnGap":"0.5em","fontSize":"12px","marginBottom":"10px",".gb-shape svg":{"width":"1em","height":"1em","color":"var(\u002d\u002dbase-3)","fill":"var(\u002d\u002dbase-3)"},"textDecoration":"none","marginLeft":"auto"},"css":".gb-text-b4501721{align-items:center;column-gap:0.5em;display:inline-flex;font-size:12px;margin-bottom:10px;margin-left:auto;text-decoration:none}.gb-text-b4501721 .gb-shape svg{width:1em;height:1em;color:var(\u002d\u002dbase-3);fill:var(\u002d\u002dbase-3)}","htmlAttributes":{"href":"{{post_permalink source:next-post}}"},"iconLocation":"after","metadata":{}} -->
    <a class="gb-text-b4501721" href="{{post_permalink source:next-post}}"><span class="gb-text">NEXT</span><span class="gb-shape"><svg viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></span></a>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/text {"uniqueId":"06ac2319","tagName":"a","styles":{"display":"inline-flex","alignItems":"center","columnGap":"0.5em","fontSize":"20px","marginBottom":"10px",".gb-shape svg":{"width":"1em","height":"1em","fill":"var(\u002d\u002dbase-3)"},"textDecoration":"none","textAlign":"right"},"css":".gb-text-06ac2319{align-items:center;column-gap:0.5em;display:inline-flex;font-size:20px;margin-bottom:10px;text-align:right;text-decoration:none}.gb-text-06ac2319 .gb-shape svg{width:1em;height:1em;fill:var(\u002d\u002dbase-3)}","htmlAttributes":{"href":"{{post_permalink source:next-post}}"},"metadata":{},"className":"hide-on-mobile"} -->
    <a class="gb-text gb-text-06ac2319 hide-on-mobile" href="{{post_permalink source:next-post}}">{{post_title source:next-post}}</a>
    <!-- /wp:generateblocks/text --></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/element -->
    
    <!-- wp:generateblocks/element {"uniqueId":"8b5343c6","tagName":"div","styles":{"@media (max-width:1024px)":{"paddingLeft":"40px","paddingRight":"40px"},"@media (max-width:767px)":{"paddingLeft":"30px","paddingRight":"30px"},"backgroundColor":"var(\u002d\u002daccent)","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center","flexGrow":"1","flexShrink":"1","flexBasis":"50%","paddingTop":"80px","paddingLeft":"80px","paddingRight":"80px","paddingBottom":"80px"},"css":".gb-element-8b5343c6{align-items:center;background-color:var(\u002d\u002daccent);display:flex;flex-basis:50%;flex-direction:column;flex-grow:1;flex-shrink:1;justify-content:center;padding:80px}@media (max-width:1024px){.gb-element-8b5343c6{padding-left:40px;padding-right:40px}}@media (max-width:767px){.gb-element-8b5343c6{padding-left:30px;padding-right:30px}}","htmlAttributes":{},"metadata":{}} -->
    <div class="gb-element-8b5343c6"><!-- wp:generateblocks/element {"uniqueId":"f33e0cce","tagName":"div","styles":{},"htmlAttributes":{},"metadata":{}} -->
    <div><!-- wp:generateblocks/text {"uniqueId":"537c1ab5","tagName":"p","styles":{"display":"flex","alignItems":"center","columnGap":"0.5em","fontSize":"14px","marginBottom":"10px",".gb-shape svg":{"width":"1em","height":"1em"}},"css":".gb-text-537c1ab5{align-items:center;column-gap:0.5em;display:flex;font-size:14px;margin-bottom:10px}.gb-text-537c1ab5 .gb-shape svg{width:1em;height:1em}","htmlAttributes":{},"metadata":{}} -->
    <p class="gb-text-537c1ab5"><span class="gb-shape"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H289.9L247 53.1C233.5 39.6 215.2 32 196.1 32H64zM48 96c0-8.8 7.2-16 16-16H196.1c6.4 0 12.5 2.5 17 7l45.3 45.3c7.5 7.5 17.7 11.7 28.3 11.7H448c8.8 0 16 7.2 16 16v32H48V96zm0 144H464V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V240z"></path></svg></span><span class="gb-text">{{term_list link:term|tax:category}}</span></p>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/text {"uniqueId":"09519cc3","tagName":"h1","styles":{"@media (max-width:767px)":{"textAlign":"left"},"textAlign":"left"},"css":".gb-text-09519cc3{text-align:left}@media (max-width:767px){.gb-text-09519cc3{text-align:left}}","htmlAttributes":{},"metadata":{},"className":""} -->
    <h1 class="gb-text gb-text-09519cc3">{{post_title}}</h1>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/element {"uniqueId":"caf6db71","tagName":"div","styles":{"display":"flex","columnGap":"1em","marginBottom":"20px"},"css":".gb-element-caf6db71{column-gap:1em;display:flex;margin-bottom:20px}","htmlAttributes":{},"metadata":{}} -->
    <div class="gb-element-caf6db71"><!-- wp:generateblocks/text {"uniqueId":"e420a25c","tagName":"p","styles":{"fontSize":"14px","marginBottom":"0px"},"css":".gb-text-e420a25c{font-size:14px;margin-bottom:0px}","htmlAttributes":{},"metadata":{}} -->
    <p class="gb-text gb-text-e420a25c">{{post_date}}</p>
    <!-- /wp:generateblocks/text -->
    
    <!-- wp:generateblocks/text {"uniqueId":"02b6ae77","tagName":"p","styles":{"fontSize":"14px","marginBottom":"0px","a":{"textDecoration":"underline"}},"css":".gb-text-02b6ae77{font-size:14px;margin-bottom:0px}.gb-text-02b6ae77 a{text-decoration:underline}","htmlAttributes":{},"metadata":{},"className":""} -->
    <p class="gb-text gb-text-02b6ae77">By {{author_meta key:display_name|link:author_archive}}</p>
    <!-- /wp:generateblocks/text --></div>
    <!-- /wp:generateblocks/element -->
    
    <!-- wp:generateblocks/element {"uniqueId":"eff8c09a","tagName":"div","styles":{"@media (max-width:1024px)":{"flexDirection":"column","rowGap":"10px"},"display":"flex","justifyContent":"flex-start","columnGap":"1em","textAlign":"left"},"css":".gb-element-eff8c09a{column-gap:1em;display:flex;justify-content:flex-start;text-align:left}@media (max-width:1024px){.gb-element-eff8c09a{flex-direction:column;row-gap:10px}}","htmlAttributes":{},"metadata":{}} -->
    <div class="gb-element-eff8c09a"><!-- wp:generatepress/dynamic-content {"contentType":"post-content"} /--></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/element --></div>
    <!-- /wp:generateblocks/loop-item --></div>
    <!-- /wp:generateblocks/looper --></div>
    <!-- /wp:generateblocks/query -->

    If you don’t know how to paste code to block editor, check this video:

    Let me know if this works.

  • Thank you, Ying! This is exactly it. 🙏

  • You are welcome   🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.