For many websites, blogging has become an important part of their SEO strategy. But besides creating high-quality content, itβs also important to simplify the post navigation process for your visitors. That way, they can hop from one post to another and spend more time on your website reading the content you put out there. Within Divi, thereβs a Blog Module you can use to dynamically display your blog posts and style them as well. If youβre looking for a way to take the post search experience to the next level, youβre going to love this post. Weβll show you how to turn the built-in Divi Blog Module into an advanced draggable/swipe carousel with Diviβs built-in elements and the free slick js library. Youβll be able to download the JSON file for free as well!
Letβs get to it.
- 1 Preview
- 2 Download The Blog Module Draggable Swipe Carousel Layout for FREE
- 3 Download For Free
- 4 You have successfully subscribed. Please check your email address to confirm your subscription and get access to free weekly Divi layout packs!
- 5 1. Create Blog Page
- 6 2. Create Previous & Next Arrow Designs Using Blurb Modules
- 7 3. Prepare the Blog Module
- 8 4. Add Slick JS Functionality
- 9 5. Save Page & Exit Visual Builder to View Outcome
- 10 Preview
- 11 Final Thoughts
Preview
Before we dive into the tutorial, letβs take a quick look at the outcome across different screen sizes.
Desktop
Mobile
Download The Blog Module Draggable Swipe Carousel Layout for FREE
To lay your hands on the free Blog Module draggable swipe carousel layout, you will first need to download it using the button below. To gain access to the download you will need to subscribe to our newsletter by using the form below. As a new subscriber, you will receive even more Divi goodness and a free Divi Layout pack every Monday! If youβre already on the list, simply enter your email address below and click download. You will not be βresubscribedβ or receive extra emails.
1. Create Blog Page
Add New Page
Start by adding a new page to the website youβre working on. Give your page a title, publish the page and switch over to Visual Builder.
Upload Interior Design Company Blog Page Layout
In this use case tutorial, weβll use the Interior Design Company blog layout but youβre free to use any other layout of your choice.
2. Create Previous & Next Arrow Designs Using Blurb Modules
Add New Row to Top of Section
Column Structure
Once weβre inside the blog page, we can start building the advanced draggable swipe carousel. The first part is dedicated to designing the arrows we need to allow visitors to go back and forth between posts. The arrows wonβt be the only option visitors have to navigate through the carousel. Theyβll be able to drag the carousel on desktop and swipe on mobile as well. To design the arrows, weβll use Diviβs built-in Blurb Module but youβre free to use any other module of your choice. Add a new row to the top of your blog section using the following column structure:
Sizing
Without adding any modules yet, open the row settings and allow the row to touch the left and right side of the section by changing the sizing settings as follows:
- Width: 100%
- Max Width: 100%
Add Blurb Module
Add Title
Then, add a Blurb Module and insert a title.
Select Icon
Select an icon next.
Icon Settings
Move on to the design tab and change the icon settings as follows:
- Icon Color: #000000
- Circle Icon: Yes
- Circle Color: #f2f2f2
- Image/Icon Placement: Top
- Image/Icon Alignment: Center
Title Text Settings
Then, modify the title text settings.
- Title Font: Muli
- Title Font Weight: Semi Bold
- Title Text Alignment: Center
- Title Text Color: #000000
Sizing
Weβre changing the moduleβs sizing settings across different screen sizes next.
- Width: 10% (Desktop), 20% (Tablet), 30% (Phone)
- Module Alignment: Right
CSS Class
And weβll also add a CSS class. This CSS class will help us trigger the carousel action on click later on the tutorial.
- CSS Class: back-button
Main Element CSS
Last but not least, weβll also add one line of CSS code to the moduleβs main element to change the cursor into a pointer.
cursor: pointer;
Clone Row & Place at Bottom of Section
Once youβve completed the first arrow, you can clone the entire row container and place the duplicate row at the end of the blog section.
Change Title
Open the Blurb Module in the duplicate row and change the title.
Change Icon
Along with the icon.
Change CSS Class
And modify the CSS class as well.
- CSS Class: next-button
3. Prepare the Blog Module
Open Row Containing Blog Module
Sizing
Once the arrows are in place, itβs time to start tweaking the Blog Module, starting with the row itβs placed in. Open the row settings and modify the sizing settings accordingly:
- Width: 100%
- Max Width: 100%
Visibility
Then, place the rowβs overflows to hidden. This will help ensure that the carousel doesnβt cause any horizontal scroll bar to appear within our page.
- Horizontal Overflow: Hidden
- Vertical Overflow: Hidden
Modify Blog Module
Hide Pagination
Once the row settings are in place, open the Blog Module settings. Make sure the pagination is disabled in the elements settings.
- Show Pagination: No
Layout
Then, move on to the design tab and change the layout to fullwidth.
- Layout: Fullwidth
Overlay
Weβre adding an overlay too.
- Featured Image Overlay: On
- Overlay Icon Color: #ffffff
- Overlay Background Color: rgba(1,0,66,0.33)
CSS Class
Next, weβll add a CSS class to our blog, which will help us enable the carousel later on the tutorial.
- CSS Class: blog-module
Post Meta CSS
And weβll generate some space between the post meta and excerpt by adding some bottom margin to the post meta CSS element in the advanced tab.
margin-bottom: 50px;
4. Add Slick JS Functionality
Add Code Module Below Blog Module
Once all the Divi settings are in place, itβs time to add the slick js functionality! Add a Code Module right below the Blog Module (or anywhere else on the page).
Add Slick JS Script Tags
Then, add the slick js library within script tags (as you can see in the print screen below). Youβre free to add these to the head of your website in the Divi theme settings as well.
src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.js
Add Slide CSS Code
Weβll slightly modify each blog post on an individual level using some CSS code. Make sure you place the code between style tags as seen in the print screen below.
.slick-slide { float: left; margin: 2vw; }
Add JQuery Code
And last but not least, weβll add some JQuery code to allow the advanced draggable swipe carousel to take its form. Within the code below, weβre also adding the buttons weβve designed to the carouselβs functionality. Make sure you place the code within script tags as you can see in the print screen below.
jQuery(function($){ var backButton = $('.back-button'); var nextButton = $('.next-button'); var postContainer = $('.blog-module .et_pb_ajax_pagination_container'); postContainer.addClass('slider'); postContainer.addClass('blog-carousel'); $('.blog-carousel').slick({ infinite: true, slidesToShow: 3, slidesToScroll: 1, centerMode: true, centerPadding: '10%', swipe: true, prevArrow: backButton, nextArrow: nextButton, responsive: [{ breakpoint: 1079, settings: { slidesToShow: 1 } }] }); });
5. Save Page & Exit Visual Builder to View Outcome
Within the Visual Builder, you wonβt see the outcome. So, as soon as youβre done, save your page, exit the Visual Builder and view the outcome on your website!
Preview
Now that weβve gone through all the steps, letβs take a final look at the outcome across different screen sizes.
Desktop
Mobile
Final Thoughts
In this post, weβve shown you how to take your Blog Module design to the next level. More specifically, weβve shown you how to turn Diviβs built-in Blog Module into an advanced draggable swipe carousel using the free slick js library. Weβve provided the JSON file for free as well! If you have any questions or suggestions, feel free to leave a comment in the comment section below.
If youβre eager to learn more about Divi and get more Divi freebies, make sure youΒ subscribe to our email newsletterΒ andΒ YouTube channelΒ so youβll always be one of the first people to know and get benefits from this free content.
Thanks… but it doesn’t look right at all.
Would it possible to integrate this dynamically with something like the next post / previous post module in Divi. Allowing readers to visually scroll through a post grid of headlines instead of just seeing headline links or text?
Doesn’t work for me.
4. Add Slick JS Functionality
Something is broken in the suggested code to be inserted in the Code module below the Blog module
Blog Section
Row
Blurb – Previous
Blog Posts Row
Blog
Code (in this section, as recommended in the )
Row
Blurb – Next
Really helpful post. Divi Changes Everything- it’s true and elegant themes are awesome.
Love you guys.
Hello Donjete, thank you for this post.
Works well on desktop, doesn’t work for me on mobile π€π₯Ί….
Hi,
It doesn’t work for me.
First, it missing the last double quote when you added the slick js library source.
Then, I still have a broken page.
I have this error (about slick js I think) :
Uncaught TypeError: $(…).slick is not a function
at HTMLDocument.
Super nice Donjete! Useful and well explained! Thanks!
Thank you Donjete, this post is really useful and explained very well. It’s time to do some experiments with the Slick.js library.