In this tutorial, we will be creating an according from the Elementor Loop Grid element. It will be a multi row accordion, meaning that the content will show up below the current row, even if there are 1, 2, 3 or more items in the row.
Yet it will all still be responsive, and on mobile, the accordion will be stacked as expected.
An added feature is that it is stable. Opening an accordion lower down the page, while another one is already open, won't create any change in the scroll position of the page, leading to much better UX. Normal accordions would change the scroll position, and then the users have to go and try to find where they were... none of that here.
We will be using the Elementor Loop Grid element, and a custom loop template.
See the demo here:
Features:
- Stable: no annoying change in scroll position.
- Fully responsive: 3 row on desktop, 2 on tablet, 1 on mobile? no problems!
- Design freedom: while my demo above is not going to win design awards, yours might! You can design the cards as you wish.
- Fully dynamic: we are using the Loop Grid element with the Loop template, so all the content is fully dynamic, from posts or a CPT.
- Ideal for team members sections
- Ideal for WooCommerce Products listings: works well instead of a quick view lightbox
- Easy to replicate: copy paste the templates
Let's get started!
First, let's get our loop template created
This is a premium tutorial. Purchase access to unlock the full tutorial.
4 Responses
You need to add the class name loopAccordionListing to the loop grid for this to work
Thanks Jake! I updated the tutorial with this information (that indeed I originally forgot).
Hi, thanks for the tutorial, I've been following your blog since 2021, recently I got some money to buy the premium access.
I have a question about this tutorial.
I need to change it so that the accordion appears to the right of the post card, instead of below, how can I do that?
Hey Simpplim!
Sorry this isn't possible with the current tutorial.
I don't really understand what should be happening with the content that's on the right too? Or would only 1 per line be shown?
Anyhow, I'd suggest trying with this tutorial here: https://element.how/elementor-show-hide-section/
Create your loop template as you normally would, but have a container in there that has the class 'toggleContent', and have a button with 'toggleElem'. Then place the accordion content within 'toggleContent'.
Cheers!