- This topic has 14 replies, 2 voices, and was last updated 3 years, 9 months ago by
David.
-
AuthorPosts
-
July 1, 2022 at 3:14 am #2270098
Marius
Hello,
I have copied the Query Loops Block code von GPB to make a Blog Site. But when I click on a category, the Archive shows in a completely and ugly other design. This is bad.
So, what can I do, that all Post Archives and Blog Page looks the same, like the Query Loop?July 1, 2022 at 5:26 am #2270185David
StaffCustomer SupportHi there,
in the next GP Premium update we will be adding a new Element Type that allows you to replace the Theme archives with those GBP Query Loops.
In the meantime, it can be done using a Block Element – Content Template:
https://docs.generatepress.com/article/block-element-content-template/
Which GBP Query Loop pattern did you use ? Can i see it ?
July 1, 2022 at 5:39 am #2270192Marius
Hi David,
thanks for your answer.
If I do it with Block Element content Template, do you mean I have to rebuild the Query Loop? If so, are there the exact same settings available as in the Query Loop? Because I take a look, and dont know ho I would do this there.
Would it be better to wait for the Update you mentioned? Do you know when it will be released?
I use the free Query Loop from GPB, but with some changes.
But I build the design on a not public website and I cannot set a staging site because my Hoster did not have this feature, so I cannot show this site.
July 1, 2022 at 6:09 am #2270215David
StaffCustomer SupportYou can try this:
1. Appearance > Elements –> New Block
2. Set the Element Type to: Content Template.
3. In the 3 dot top bar menu, switch to code view:
4. In the code editor paste the following code:<!-- wp:generateblocks/image {"uniqueId":"2265530a","sizeSlug":"full","useDynamicData":true,"dynamicContentType":"featured-image","dynamicLinkType":"single-post"} /--> <!-- wp:generateblocks/container {"uniqueId":"4a0e425e","paddingTop":"12","paddingRight":"18","paddingBottom":"18","paddingLeft":"18","backgroundColor":"var(\u002d\u002dbase-2)","zindex":0,"isDynamic":true,"blockVersion":2} --> <!-- wp:generateblocks/image {"uniqueId":"0f810950","sizeSlug":"thumbnail","width":"36px","height":"36px","borderColor":"var(\u002d\u002dbase-3)","alignment":"floatLeft","useDynamicData":true,"dynamicContentType":"author-avatar","marginRight":"4","borderSizeTop":"2","borderSizeRight":"2","borderSizeBottom":"2","borderSizeLeft":"2","borderRadiusTopRight":"36","borderRadiusBottomRight":"36","borderRadiusBottomLeft":"36","borderRadiusTopLeft":"36"} /--> <!-- wp:generateblocks/headline {"uniqueId":"1710792f","element":"div","fontWeight":"700","fontSize":14,"marginBottom":"12","inlineWidth":true,"useDynamicData":true,"dynamicContentType":"author-name"} --> <div class="gb-headline gb-headline-1710792f gb-headline-text"></div> <!-- /wp:generateblocks/headline --> <!-- wp:generateblocks/headline {"uniqueId":"d8375f7c","element":"div","borderColor":"var(\u002d\u002dcontrast-3)","fontWeight":"700","fontSize":14,"marginBottom":"12","marginLeft":"6","paddingLeft":"6","borderSizeLeft":"2","inlineWidth":true,"useDynamicData":true,"dynamicContentType":"post-date"} --> <div class="gb-headline gb-headline-d8375f7c gb-headline-text"></div> <!-- /wp:generateblocks/headline --> <!-- wp:generateblocks/headline {"uniqueId":"bcdb0fb1","textColor":"#222222","linkColor":"#222222","linkColorHover":"#575760","fontSize":20,"marginTop":"6","marginBottom":"6","useDynamicData":true,"dynamicContentType":"post-title","dynamicLinkType":"single-post"} --> <h2 class="gb-headline gb-headline-bcdb0fb1 gb-headline-text"></h2> <!-- /wp:generateblocks/headline --> <!-- wp:generateblocks/headline {"uniqueId":"b0e62723","element":"p","fontSize":15,"useDynamicData":true,"dynamicContentType":"post-excerpt","useDefaultMoreLink":false,"excerptLength":15} --> <p class="gb-headline gb-headline-b0e62723 gb-headline-text"></p> <!-- /wp:generateblocks/headline --> <!-- wp:generateblocks/button-container {"uniqueId":"f4522935","isDynamic":true,"blockVersion":2} --> <!-- wp:generateblocks/button {"uniqueId":"5904d52c","hasUrl":false,"backgroundColor":"#0366d6","backgroundColorHover":"#222222","textColor":"#ffffff","textColorHover":"#ffffff","fontWeight":"700","fontSize":10,"textTransform":"uppercase","letterSpacing":0.18,"marginRight":"2","paddingTop":"4","paddingRight":"6","paddingBottom":"4","paddingLeft":"6","blockVersion":2,"useDynamicData":true,"dynamicContentType":"terms","dynamicLinkType":"term-archives","termTaxonomy":"category"} --> <span class="gb-button gb-button-5904d52c gb-button-text">Button</span> <!-- /wp:generateblocks/button --> <!-- /wp:generateblocks/button-container --> <!-- /wp:generateblocks/container -->5. Switch back to the Visual editor.
You should see the single content template, with placeholder text.
Adjust it how you need it.6. Set the Display Rule Locations:
All Archives BlogAnd then you should see the same design as the your Query Loops.
The alternative is to wait for the update. It will be soon but we are probably a few weeks before we release a beta version for testing.
July 1, 2022 at 7:11 am #2270264Marius
Thanks, this works very well.
The only problem is, that on the archive, the containers are separated and on blog page not.
Blog Page:
https://prnt.sc/fEajClNtccaHArchive:
https://prnt.sc/XT0L4G1yXzIWi can’t decide yet which version looks better, but how can i make them both look the same?
July 1, 2022 at 7:18 am #2270272David
StaffCustomer SupportIn Customizer > Layout > Container you cans set the:
Content Layoutto:One ContainerJuly 1, 2022 at 7:23 am #2270278Marius
Yes, I know, but this is for the whole site.
I now have container separated, but the blog page with query loop is not separated. Why is that? And can i make this separated too?July 2, 2022 at 1:21 am #2270903Marius
Hi David,
I have another question. With the code you provided, each post has a button for the categories. Is it possible the make this button a read more button? I have tried it, but with no success. Unfortunately, I can’t see through all the settings there yet.
July 2, 2022 at 5:33 am #2271054David
StaffCustomer Support1. Edit the Element Content Template, in the sidebar with the Element tab selected, check the
Keep default post containerthis will give you the separated containers.2. Add a GB Buttons block, type straight into the label your text eg.
Read more
then set the dynamic settings like so:July 2, 2022 at 6:24 am #2271082Marius
Hi David,
thanks a lot.
For 2: Can I also use the categories button for this, which is already there? Because it looks good.
July 2, 2022 at 7:15 am #2271106David
StaffCustomer SupportYes, make a Duplicate of the ButtonSSSS Block – emphasis on the S there 🙂 – that contains the Category button
See here:https://www.screencast.com/t/YmB4RQ1eqsgs
Then change its settings to the ones i provided above.
July 2, 2022 at 7:27 am #2271113Marius
Hi David,
thanks, but I meant if I can keep this button but it gets the function of a Read More button. I don’t need a category button.
July 2, 2022 at 7:44 am #2271125David
StaffCustomer SupportThen you can just select the category button and change it settings to those i provided here:
https://generatepress.com/forums/topic/archive-with-query-loop/#post-2271054
July 2, 2022 at 8:01 am #2271262Marius
Ahhh, that was easy. I would not have thought that.
thank you very much, that worked well.
July 2, 2022 at 8:05 am #2271266David
StaffCustomer SupportAwesome – glad to hear that!
-
AuthorPosts
- You must be logged in to reply to this topic.