Site logo

Archived topic

Help me to fix layout

7 replies · Started by Growthonics on November 24, 2022

Viewing posts 1–8 of 8

Hi there,

use the GenerateBlocks Query Loop block, it provides full styling controls.
To save you some time i created one, just copy the code below and paste it into the block editor:


<!-- wp:generateblocks/query-loop {"uniqueId":"f3d4f9f3","query":{"post_type":"post","per_page":"5"}} -->
<!-- wp:generateblocks/grid {"uniqueId":"a65f5070","columns":1,"isDynamic":true,"blockVersion":2,"isQueryLoop":true,"lock":{"remove":true}} -->
<!-- wp:generateblocks/container {"uniqueId":"dface3c7","isGrid":true,"isQueryLoopItem":true,"gridId":"a65f5070","width":100,"isDynamic":true,"blockVersion":2,"lock":{"remove":true,"move":true}} -->
<!-- wp:generateblocks/grid {"uniqueId":"9431d226","columns":2,"verticalGap":20,"isDynamic":true,"blockVersion":2} -->
<!-- wp:generateblocks/container {"uniqueId":"72b116f4","isGrid":true,"gridId":"9431d226","width":50,"widthMobile":100,"flexBasis":"100","flexBasisMobile":"100","isDynamic":true,"blockVersion":2} -->
<!-- wp:generateblocks/image {"uniqueId":"511c2cea","sizeSlug":"thumbnail","width":"100px","height":"100px","useDynamicData":true,"dynamicContentType":"featured-image"} /-->
<!-- /wp:generateblocks/container -->

<!-- wp:generateblocks/container {"uniqueId":"bceee85e","isGrid":true,"gridId":"9431d226","width":50,"flexGrow":1,"flexBasisMobile":"auto","paddingLeft":"20","isDynamic":true,"blockVersion":2} -->
<!-- wp:generateblocks/headline {"uniqueId":"6892c913","backgroundColor":"","fontSize":20,"useDynamicData":true,"dynamicContentType":"post-title"} -->
<h2 class="gb-headline gb-headline-6892c913 gb-headline-text"></h2>
<!-- /wp:generateblocks/headline -->
<!-- /wp:generateblocks/container -->
<!-- /wp:generateblocks/grid -->
<!-- /wp:generateblocks/container -->
<!-- /wp:generateblocks/grid -->
<!-- /wp:generateblocks/query-loop -->

Your code is commented, should i still copy paste?

Yes... those Comments are what WordPress uses in the editor for the Blocks HTML.
Just paste it into an empty Text block

I edited the code above so it keeps the layout on mobile.

Each block in the query loop has its own style controls, select a block and check the sidebar settings where you can make Typography, Color, Spacing adjustments.

Thank you, David!

You're welcome

This archived topic is closed to new replies.