Site logo

Archived topic

How to align grids

27 replies · Started by Ajay on January 16, 2023

Viewing posts 16–28 of 28

i an using generatblocks pro where i can see the option of sticky post suppose i want to display 4-5 sticky post on homepage with all posts what should i do for example this website please check in private box

It's possible but you'll need to exclude the sticky posts for the homepage on your Current Query Loop.

Then, create a new loop for the sticky posts. We'll need custom code to make sure it grabs only 5.

Alternatively, you can just opt to include the sticky posts manually in the parameters. This could work as well.

alright but what if i want to stick search bar on the top while scrolling up the page posts

code is not working in related posts please look in private box

If it works on one Query Loop, then copy that query loop block and use it on your other pages. Then the CSS will work.

nope it is not working

The site seems to be currently under maintenance. We can't view it. Can you disable that setting temporarily so we can see why it's not working?

oh sorry now please check

Add cu-query-loop to the class list of the Grid Block under the Query Loop Block.

Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/

Then, add this CSS instead:

.gb-grid-wrapper.gb-query-loop-wrapper.cu-query-loop .gb-query-loop-item > .gb-container .gb-inside-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gb-grid-wrapper.gb-query-loop-wrapper.cu-query-loop .gb-query-loop-item > .gb-container .gb-inside-container > *:nth-last-child(2) {
    margin-top: auto;
}

but what should i do with your before code?

You can remove it. Just make sure to add cu-query-loop to all Grids under a Query Loop with the same structure.

The new code should work for all GB Query Loops with an identical structure provided that this class exists.

thanku so much code is working. i have 2 questions-
1st- how can I make search box sticky on the top as it is while scrolling up the page?
2nd - how can I make menu bar navigation pages a s a button so I could control that in generateblocks pro?

/

Can you open new topics for these two new inquiries? We'll do our best to assist you afterward.

This archived topic is closed to new replies.