Site logo

[Support request] Creating Query Loops for home page

Home Forums Support [Support request] Creating Query Loops for home page

Home Forums Support Creating Query Loops for home page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2513959
    ijzerparadijs

    Hi,

    After a few years of not using Generatepress (and WordPress) i’ve recently started with a new website. I purchased GP Premium and started using the ‘Info’ starter site. All i wanted to do was to keep block or container with the five highlighted posts and choose five posts that i want to be shown there.

    Unfortunately i made a huge mistake by deleting this block or container and now it is gone. When it was still there i wanted to choose five posts to be shown there, but i was completely clueless on how i was going to do that. I watched several YouTube-videos but still couldn’t figure out how to.

    Is there a way to get this specific block or container back? Creating a testing environment / staging website is not possible with the provider i have.
    Are there any step by step guides on how to create what i want to?

    Hopefully you can help me out.

    I’m not a native English speaker so excuse me if i made some mistakes.

    #2514035
    David
    Staff
    Customer Support

    Hi there,

    1. Create a new draft page.
    2. In the editor top bar 3 dot menu, switch to Code Editor.
    3. Paste the following code into the editor:

    
    <!-- wp:generateblocks/container {"uniqueId":"6e85cd0d","paddingBottom":"20","isDynamic":true,"blockVersion":2} -->
    <!-- wp:generateblocks/grid {"uniqueId":"c4a35da7","columns":2,"horizontalGap":10,"verticalGap":0,"isDynamic":true,"blockVersion":2} -->
    <!-- wp:generateblocks/container {"uniqueId":"f18cd594","isGrid":true,"gridId":"c4a35da7","width":50,"widthMobile":100,"verticalAlignment":"flex-end","removeVerticalGap":true,"removeVerticalGapMobile":true,"isDynamic":true,"blockVersion":2,"useDynamicData":true,"dynamicContentType":"featured-image","className":"full-height"} -->
    <!-- wp:generateblocks/query-loop {"uniqueId":"0f2996e7","query":{"post_type":"post","per_page":"1"}} -->
    <!-- wp:generateblocks/grid {"uniqueId":"f960c789","columns":1,"verticalGap":10,"isDynamic":true,"blockVersion":2,"isQueryLoop":true,"lock":{"remove":true},"className":"full-height"} -->
    <!-- wp:generateblocks/container {"uniqueId":"3388e468","isGrid":true,"isQueryLoopItem":true,"gridId":"f960c789","width":100,"widthMobile":100,"minHeightMobile":200,"paddingTop":"20","paddingRight":"20","paddingBottom":"20","paddingLeft":"20","backgroundColor":"var(\u002d\u002dcontrast)","textColor":"var(\u002d\u002dbase-3)","linkColor":"var(\u002d\u002dbase-3)","bgOptions":{"selector":"pseudo-element","opacity":0.4,"overlay":false,"position":"center center","size":"cover","repeat":"no-repeat","attachment":""},"bgImageInline":true,"verticalAlignment":"flex-end","verticalAlignmentMobile":"flex-end","innerZindex":1,"isDynamic":true,"blockVersion":2,"useDynamicData":true,"dynamicContentType":"featured-image","lock":{"remove":true,"move":true}} -->
    <!-- wp:generateblocks/headline {"uniqueId":"1c78bfc1","element":"h6","fontSize":13,"textTransform":"uppercase","useDynamicData":true,"dynamicContentType":"terms","dynamicLinkType":"term-archives","termTaxonomy":"category"} -->
    <h6 class="gb-headline gb-headline-1c78bfc1 gb-headline-text"></h6>
    <!-- /wp:generateblocks/headline -->
    
    <!-- wp:generateblocks/headline {"uniqueId":"ec7c0224","element":"h3","backgroundColor":"","textColor":"","linkColor":"","linkColorHover":"","borderColor":"","fontSizeMobile":18,"marginBottom":"13","useDynamicData":true,"dynamicContentType":"post-title","dynamicLinkType":"single-post"} -->
    <h3 class="gb-headline gb-headline-ec7c0224 gb-headline-text"></h3>
    <!-- /wp:generateblocks/headline -->
    
    <!-- wp:generateblocks/headline {"uniqueId":"93d318ca","element":"div","backgroundColor":"","textColor":"","linkColor":"","linkColorHover":"","borderColor":"","highlightTextColor":"","fontSize":13,"textTransform":"capitalize","iconColor":"","inlineWidth":true,"useDynamicData":true,"dynamicContentType":"post-date","dateReplacePublished":true,"termTaxonomy":"category"} -->
    <div class="gb-headline gb-headline-93d318ca gb-headline-text"></div>
    <!-- /wp:generateblocks/headline -->
    
    <!-- wp:generateblocks/headline {"uniqueId":"b711c1fd","element":"div","backgroundColor":"","fontSize":13,"textTransform":"lowercase","paddingLeft":"1","paddingUnit":"em","iconColor":"","inlineWidth":true,"dynamicContentType":"author-name","termTaxonomy":"category"} -->
    <div class="gb-headline gb-headline-b711c1fd gb-headline-text">BY </div>
    <!-- /wp:generateblocks/headline -->
    
    <!-- wp:generateblocks/headline {"uniqueId":"e9cec236","element":"div","fontSize":13,"textTransform":"capitalize","inlineWidth":true,"useDynamicData":true,"dynamicContentType":"author-name","termTaxonomy":"category"} -->
    <div class="gb-headline gb-headline-e9cec236 gb-headline-text"></div>
    <!-- /wp:generateblocks/headline -->
    <!-- /wp:generateblocks/container -->
    <!-- /wp:generateblocks/grid -->
    <!-- /wp:generateblocks/query-loop -->
    <!-- /wp:generateblocks/container -->
    
    <!-- wp:generateblocks/container {"uniqueId":"85bb5d2e","isGrid":true,"gridId":"c4a35da7","width":50,"widthMobile":100,"verticalAlignment":"flex-end","removeVerticalGap":true,"isDynamic":true,"blockVersion":2} -->
    <!-- wp:generateblocks/query-loop {"uniqueId":"00acc91d","query":{"post_type":"post","per_page":"4","offset":"1"}} -->
    <!-- wp:generateblocks/grid {"uniqueId":"1fb3fb36","columns":1,"horizontalGap":10,"verticalGap":10,"isDynamic":true,"blockVersion":2,"isQueryLoop":true,"lock":{"remove":true}} -->
    <!-- wp:generateblocks/container {"uniqueId":"e1e8bef5","isGrid":true,"isQueryLoopItem":true,"gridId":"1fb3fb36","width":50,"widthMobile":100,"minHeight":200,"paddingTop":"20","paddingRight":"20","paddingBottom":"20","paddingLeft":"21","backgroundColor":"var(\u002d\u002dcontrast)","textColor":"var(\u002d\u002dbase-3)","linkColor":"var(\u002d\u002dbase-3)","bgOptions":{"selector":"pseudo-element","opacity":0.4,"overlay":false,"position":"center center","size":"cover","repeat":"no-repeat","attachment":""},"bgImageInline":true,"verticalAlignment":"flex-end","verticalAlignmentTablet":"flex-start","verticalAlignmentMobile":"flex-end","innerZindex":1,"shapeDividers":[],"isDynamic":true,"blockVersion":2,"useDynamicData":true,"dynamicContentType":"featured-image","lock":{"remove":true,"move":true}} -->
    <!-- wp:generateblocks/headline {"uniqueId":"73ac9432","element":"h6","fontSize":13,"textTransform":"uppercase","useDynamicData":true,"dynamicContentType":"terms","dynamicLinkType":"term-archives","termTaxonomy":"category"} -->
    <h6 class="gb-headline gb-headline-73ac9432 gb-headline-text"></h6>
    <!-- /wp:generateblocks/headline -->
    
    <!-- wp:generateblocks/headline {"uniqueId":"19674ae8","element":"h3","backgroundColor":"","textColor":"","linkColor":"","linkColorHover":"","borderColor":"","fontSize":18,"marginBottom":"13","iconColor":"","useDynamicData":true,"dynamicContentType":"post-title","dynamicLinkType":"single-post"} -->
    <h3 class="gb-headline gb-headline-19674ae8 gb-headline-text"></h3>
    <!-- /wp:generateblocks/headline -->
    <!-- /wp:generateblocks/container -->
    <!-- /wp:generateblocks/grid -->
    <!-- /wp:generateblocks/query-loop -->
    <!-- /wp:generateblocks/container -->
    <!-- /wp:generateblocks/grid -->
    <!-- /wp:generateblocks/container -->

    4. Switch to Visual Editor.

    You can now copy that block to where you need it.

    #2514046
    ijzerparadijs

    Thanks, that helps alot! Via parameters i can regulate what is shown and what isn’t, right?

    #2514133
    David
    Staff
    Customer Support

    Yes, see my reply here it shows how to access the parameters:

    https://generatepress.com/forums/topic/info-template-how-do-i-automate-the-posts-that-appear-on-the-home-page/#post-2513964

    Just Add Parameter to get started.

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