- This topic has 30 replies, 4 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
January 11, 2023 at 3:54 am #2491181
russel
I don’t want to open multiple threads for each problem/roadblock so I’ll post it here
I need to accomplish this design
Can I achieve this using GP?
January 11, 2023 at 11:08 am #2491801Leo
StaffCustomer SupportHi there,
Yes – the Query Loop block would be what you need:
https://docs.generateblocks.com/article/query-loop-overview/January 11, 2023 at 9:26 pm #2492299russel
So I watch some tutorials on how to use query loop but it seems only applicable to “pages”
I need to edit my homepage. is there some workaround to use it on the homepage?
January 11, 2023 at 10:18 pm #2492325Fernando Customer Support
Hi Russel,
I believe your homepage is a Blog page. If so, you can use a Block Element – Content Template instead: https://docs.generatepress.com/article/block-element-content-template/
There’s a video here showing how to implement that.
Alternatively, if you want to use a Query Loop Block, you can use a Block Element – Loop Template instead. Reference: https://docs.generatepress.com/article/block-element-loop-template/
January 12, 2023 at 7:01 pm #2493640russel
Would you be able to provide a design pattern to achieve this or do I need GenerateBlock Pro first (the red circle)?
[img]https://i.imgur.com/YcF8bDu.jpg[/img]
January 12, 2023 at 7:46 pm #2493664Fernando Customer Support
There are a couple of free Patterns here you can copy and paste: https://generateblocks.com/library/?pattern-category=query-loop
You can also avail GB Pro to use the Premium patterns in the link I shared.
Alternatively, you can also opt to build the Query from scratch. It seems fairly doable.
January 12, 2023 at 9:17 pm #2493713russel
Can’t see any design that has a long underline underneath the text similar to design I provided
How can I do that?
January 12, 2023 at 9:34 pm #2493730Fernando Customer Support
You can add a bottom border size to the Headline Block for the text “Dark FAQ’s…” Reference: https://docs.generateblocks.com/article/headline-overview/#border-size
We can also do it through custom CSS. If you can provide the link where we can see this, we can try to assist you with the code.
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
January 12, 2023 at 9:51 pm #2493744russel
see message below
January 12, 2023 at 10:25 pm #2493766Fernando Customer Support
There seem to be 4 different “titles” for your reference site for that section.
Are you looking for something similar? Or do you just need to query the 4 latest posts?
January 12, 2023 at 11:09 pm #2493783russel
I would like to make that block as a “cornerstone/featured” section where I can put 4 featured article of my choice instead of latest post
January 12, 2023 at 11:35 pm #2493796Fernando Customer Support
What did you go with? Did you use a Loop Template or a Content Template?
Do you already have the Query setup?
Can you provide the link to your site where we can view what you have right now?
January 13, 2023 at 3:49 am #2494044russel
I went through your suggestion yesterday to use a block element – content template, and I’ve been following this video that you also provided:
I only have a draft of the element section since I encountered a roadblock already (the underline thing).
So I won’t be able to provide any design. But I can provide the login if you want.
January 13, 2023 at 6:45 am #2494201David
StaffCustomer SupportHi there,
remove what you have in your Element so far ( or create a new one ).
From the 3 dot menu, select the Code Editor.
Copy and Paste the following code in:<!-- wp:generateblocks/container {"uniqueId":"b373b9fe","paddingTop":"40","paddingRight":"40","paddingBottom":"40","paddingLeft":"40","paddingSyncUnits":true,"backgroundColor":"var(\u002d\u002dcontrast)","textColor":"var(\u002d\u002dbase-3)","linkColor":"var(\u002d\u002dbase-3)","linkColorHover":"var(\u002d\u002dbase-3)","isDynamic":true,"blockVersion":2} --> <!-- wp:generateblocks/headline {"uniqueId":"688bb3b6","backgroundColor":"","textColor":"","linkColor":"","linkColorHover":"","borderColor":"","highlightTextColor":"","paddingBottom":"5","borderSizeBottom":"2","iconColor":""} --> <h2 class="gb-headline gb-headline-688bb3b6 gb-headline-text">You're H2 Headline</h2> <!-- /wp:generateblocks/headline --> <!-- wp:generateblocks/query-loop {"uniqueId":"80d3970f","columns":1,"query":{"post_type":"post","per_page":10}} --> <!-- wp:generateblocks/grid {"uniqueId":"6893b420","columns":1,"horizontalGap":20,"verticalGap":20,"isDynamic":true,"blockVersion":2,"isQueryLoop":true,"lock":{"remove":true}} --> <!-- wp:generateblocks/container {"uniqueId":"3e374e8b","isGrid":true,"isQueryLoopItem":true,"gridId":"6893b420","width":25,"widthMobile":100,"paddingSyncUnits":true,"isDynamic":true,"blockVersion":2,"lock":{"remove":true,"move":true}} --> <!-- wp:generateblocks/image {"uniqueId":"8b817089","sizeSlug":"full","useDynamicData":true,"dynamicContentType":"featured-image","marginBottom":"10"} /--> <!-- wp:generateblocks/headline {"uniqueId":"b0eff81e","element":"h3","backgroundColor":"","textColor":"","linkColor":"","fontSize":"20","marginBottom":"5","useDynamicData":true,"dynamicContentType":"post-title","dynamicLinkType":"single-post"} --> <h3 class="gb-headline gb-headline-b0eff81e gb-headline-text"></h3> <!-- /wp:generateblocks/headline --> <!-- /wp:generateblocks/container --> <!-- /wp:generateblocks/grid --> <!-- /wp:generateblocks/query-loop --> <!-- /wp:generateblocks/container -->Switch back to the Visual Editor.
NOTES:
1. The parent Container Block is where i have set the colors for background, text and link. The Headline blocks inside the container will inherit them. Or you can edit the colors of each headline.
2. The underline is on the Headline Block, where i set the Spacing > Border Bottom value. The border color will inherit the above text color or you can set the Headlines > Color > Border.
January 13, 2023 at 7:31 pm #2494886russel
it works now, but now it shows multiple queries.
see here: https://darkfaqs.com/
-
AuthorPosts
- You must be logged in to reply to this topic.