How To Change The Number Of Columns In The Divi Blog Module 2 3 4 Tutorial by Pee Aye Creative 1

How To Change The Number Of Columns In The Divi Blog Module (Extremely Easy)

This tutorial will show you how to easily change the number of columns in the Divi Blog module with just two simple lines of CSS!

FYI: You can do this with a setting directly in the Divi Visual Builder with our popular Divi Responsive Helper plugin! Take a look, it is so easy!

Divi Responsive Helper Plugin 2.0 by Pee Aye Creative

Join subscribers on our YouTube channel and enjoy other Divi video tutorials!

Make Divi Blog Module Into 2 Columns

Let’s start with changing the Divi Blog module column count to two. By default, the Blog module comes in at 3 columns when the layout is set to Grid, and 1 column when the layout is set to Fullwidth.

In order to keep this very, very simple, we need to set the Layout to Fullwidth.

change the Divi blog module column number by first setting the layout to fullwidth

Now go ahead and copy and paste the two lines of CSS below into the Blog module. You will need to go the Advanced tab and open the Custom CSS toggle. There you will see the Main Element, which is exactly where you should paste this snippet.

column-count: 2;
column-gap: 60px;
Two column Divi blog module grid layout

Boom! There you go! That was incredibly easy, right?

Make Divi Blog Module Into 4 Columns

Let’s try another one. You can change the count to anythign you want, but if you go too high the postt will get too small. Also note that you can’t use 3, since 3 is the default when the module is set to Grid. So let’s set the blog module column count to 4. Like before, make sure the layout is set to Fullwidth in the Design tab.

If you pasted the snippet before, just change the number to 4 instead of 2. If not, copy the CSS snippet below and paste it into the Blog module in the Advanced tab. Just open the Custom CSS toggle and you you will see the Main Element, which is where you should paste this snippet.

column-count: 4;
column-gap: 60px;
four column Divi blog module grid layout

And there you go, you now changed the Divi blog module column count to 4 with this very easy method.

Change Blog Column Spacing

You may hvae noticed the line of CSS that says “column-gap” and were curous about that. Basically, this is the space between the columns. I set this at 60px because the blog module comes with a margin of 60px at the bottom of each post (in between the posts vertically) so I just wanted to match that. But you can change this number to anything you want! 

Change The Divi Blog Module Column Count On Mobile

Make The Divi Blog Module Columns Responsive

Now it’s time to make this responsive! So the column count you chose for your blog module will probably not work very well on smaller screen sizes. Thanksfully this is a very easy fix. We could use CSS media queries. But hey, I like to keep it simple. Let’s just use Divi!

It is very easy. Go to the Blog module settings again to where you pasted the code in the Main Element. Hover over it and you will see the little “phone” icon. Click that! Now you will see three tabs, Desktop, Tablet, and Phone. By default, the code we pasted affects all three, so we need to change our code for each device. I’ll walk you through an example.

Desktop

Let’s say I have set my Divi blog moluduel to “4” columns. That’s what I want for Desktop, so this is good.

Tablet

Copy the snippet, and now click on the Tablet tab. Paste the two lines again. This time, change the column count to “2.”

Phone

Copy the snippet again, and now click on the Phone tab. Paste the two lines again. This time, change the column count to “1.”

You could also change the column gap to a smaller number like “20px;”

To see this in action, please watch the video!

Add Some Fancy Styling

In our screenshots above, we included some extra styling. In the follow snippet, we are going to style each one of the posts by adding spacing around them, a background color, and a border radius.

There is also a very important part of the tutorial. The last three lines here are essentail for making this whole tutorial work right. It is too technical to explain, but the video shows what would happen without it. Basically the columns in Divi start on the left and go down, then over and down, etc. So this CSS keeps the the blog posts from getting chopped off weird.

/*style the individual posts*/

.et_pb_posts .et_pb_post {
	padding: 30px;
	background: #f2f2f2;
	border-radius: 10px;
	-webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */
	page-break-inside: avoid; /* Firefox */
	break-inside: avoid; /* IE 10+ */
}

That looks a great! Feel free to play around with this, and be on the lookout for more tutorials about the Divi blog module!

Do It With A Setting!

Make life easier and use the Divi Responsive Helper instead, the ultimate Divi responsive toolkit with awesome features and settings to help make your website look and work great on all devices!

Divi Responsive Helper Plugin 2.0 by Pee Aye Creative
70
Last updated Aug 31, 2021 @ 11:34 am

Please share this post!

Nelson Lee Miller (aka The Divi Teacher)

Nelson is the owner of Pee-Aye Creative Co in the beautiful state of Pennsylvania. He loves helping small businesses, exploring, building websites with Divi, and teaching others.
Divi Adventure Club Product And Course Membership by Pee Aye Creative

Become A Member!

Gain access to everything we offer!

Learn More

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

77 Comments

  1. Ramon

    Simple & Nice Nelson! Less is more!

    Reply
  2. Neil

    Hi Nelson,

    This is a great tutorial. I always enjoy your tutorials. They are simple and presented in a clear way for everyone to understand. Thanks for taking the time to create them.

    Kind regards,
    Neil.

    Reply
  3. Hadee Roslan

    Thank you Nelson for this awesome tip. Will give it a shot in my sites. This is indeed the simplest way to customize number of blog columns in Divi.

    Reply
  4. John Bendever

    Hey Nelson! This is AWESOME! One quick question…what if you wanted to equalize the grid heights to accommodate for differing excerpt and title lengths?

    Reply
  5. Bernadette Smith

    Wow, that was so easy! Thank you!

    Reply
  6. QUYEN D TRAN

    I put in the code but why does the image on the top second column is being cut off ?

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      Just add the code in the post, it describe this. -webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */
      page-break-inside: avoid; /* Firefox */
      break-inside: avoid; /* IE 10+ */

      Reply
  7. Luc Fayard

    Thank’s for these good advices. I use the layout in a test site for a list of members, in alpha sorting (via plugin Simple Custom Post Order) , with 12 items per page, with 3 rows of 4 columns, But I see that the items are to be read on each column from top to bottom and I would like them to be listed on each row from left to right. How is it possible? Luc

    Reply
  8. Rita Manaï

    Dear,
    thank you very much for your clear tutorial “how-to-change-the-number-of-columns-in-the-divi-blog-module”

    Works great!
    Still a question: why do I first see 4 and then 3 columns on one of my pages? (see: https://mijnreceptenbundel.nl/cocktails-2/cocktail-alc-vrij/)

    or better, how can I adjust this?

    thank you verry mutch

    Reply
  9. Daniel

    Any chance there is a straightforward way to have this center the blog items. So for example, if I have a 4 column setup, per your code, but in instances where they is only 1 or 2 blog posts, to have those centered in the screen instead of off to the left?

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      Hi Daniel,
      I don’t know but I definitely saw someone ask this a few weeks ago in a Facebook group and someone gave the answer. I just can’t think where it was, sorry!

      Reply
  10. David

    Great tutorial, thanks alot, clean & simple!

    Reply
  11. x_larrea

    Thanks a lot for your posts Nelson!!!
    Best Divi tutorials on the web!

    Just a tip: This is needed to work properly so I would not say “add styling”….it is confusing..
    -webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */
    page-break-inside: avoid; /* Firefox */
    break-inside: avoid; /*

    Reply
  12. Marlon

    Hi, how can i make the order from left to right instead of top to bottom.
    My magazine are displaying in weird order

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      Hi Marlon,
      I think this is because of the weird way they are made in Divi. They go by columns, down the first one, then down the second one, etc. Really annoying, so I guess this only works with one row.

      Reply
  13. Carina

    Thank you Nelson, this is a real helpful and easy tutorial! The only part where I was little bit confused was when you added the styling to the site. I first didn’t realize the code wasn’t for the blog module but for the whole website. I then checked your video and got it. Maybe you could add where to put this in in your tutorial here.

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      Hi Carina,
      Okay not sure what you mean, but I assume you are referring to the snippet that targets all blog posts. You could certainly add a custom class, I don’t say that on every post because I hope people know but it’s a valid point if that’s what you mean.

      Reply
  14. Sondra Barker

    what if I want two columns on mobile and not one?

    Reply
  15. Girish

    Hi Nelson, Thanks a lot for this tutorial. I have found a lot of valuable stuff on your website, and must say it is one of the best resources on DIVI. So thanks a lot for that.

    I tried this code and it works great, except that the navigation for pagination on the bottom (older entries and newer entries) jumps into the second column instead of spanning both the columns. I am attaching a screenshot. Is there a way or CSS to make it span so that it is not in the middle of the page.

    I am using a 2 column layout on this page.

    Thanks a lot
    Girish

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      I guess that is because it is technically thinking it is the “fullwidth” layout. Had not thought of that. Guess that is a drawback of this method.

      Reply
      • Girish

        Thanks for the update Nelson. Let me see if I can figure out a workaround for this.

      • Marloes

        Hi! Thank you for this tutorial Nelson! I have this same issue, has someone found a way to solve this in the meantime? 🙂

      • Marloes

        Ok I have a nice solution :D. I installed the plugin WP-PageNavi with the whole navigation on the right (the default) and removed the border 😀

        .wp-pagenavi {  border-top: 0px; }

  16. Amy S Chaplin

    Great idea, but didn’t work. Adding column-count:2 turned the 3 column blog into 6 rather than 2.

    Reply
  17. Mike

    Hi Nelson – I was having issues with this page:

    https://dwnsandbox1.com/news/

    After a few rounds with Elegant Themes Tech Support they suggested this article:

    “Please use the following solution instead to change Blog columns:
    https://www.peeayecreative.com/how-to-change-the-number-of-columns-in-the-divi-blog-module/

    Ta Da!

    Coincidentally, I was reading a post from you earlier tonight about hiding/showing the hamburger menu.

    Thanks for your clean and Elegant(!) solutions.

    Reply
  18. Rick

    Great lesson Nelson!
    I just have the problem, when I have an odd number of posts (for example 3), they looks in strage order, see attached image

    Reply
  19. Leah

    Thank you so much for this! I was ready to purchase a plugin from a Divi reseller to make columns happen on our landing page. I will check out your store and try to purchase from you instead!
    One addendum could be helpful: there’s no navigation to older posts? When I tried to turn it on, it was wonky.

    Reply
    • Hemant Gaba

      Thank you for checking our store. We hope that our products will surely add value to your website. Coming to the issue, just to confirm is the pagination not at its place when you are using this code?
      If yes then, please go to the Blog Module Settings > Advanced > CSS ID & Classes and add a Custom Class. For example, the class is .pa-blog-module
      After that, please go to WordPress Dashboard > Divi > Theme Options > Custom CSS Panel and place the CSS Code given below:

      .pa-blog-module{
      position: relative;
      padding-bottom: 14vh;
      }
      .pa-blog-module .wp-pagenavi {
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      }

      .pa-blog-module .wp-pagenavi .pages{
      white-space: nowrap
      }

      This code will place the pagination division at the bottom center. You can change the left, bottom, and padding values to change the placement. 🙂

      Reply
  20. Kate

    Hm… it works perfectly in Safari but not at all in Chrome.

    Reply
    • Hemant Gaba

      Could you please share the URL of the page so that I could investigate further?

      Reply
  21. Rita

    Dear Nilson,
    Unfortunately, I still have some problems with the lay-out.

    On my website all images are of the same size namely, width 350 px by height 250 px.

    The first problem is on the cocktails page.
    URL: https://mijnreceptenbundel.nl/cocktails-2/cocktails-alc-houdend/
    In all cases their maximum height should be 250 px.
    So the problem is that some of the images on the cocktails page are larger (that is the height is increased) compared to others.
    How can I solved this problem so that each image has the same height?

    The second problem is on some other pages (e.g. menues for poultry).
    URL: https://mijnreceptenbundel.nl/hoofdgerechten/gevogelte/
    On these pages I would like to have 4 images on each row. However, on same pages the columns are broken down too early and on some rows I see 4 images while other rows contain 3 images.
    How can this be solved so that each row show 4 images?

    Reply
  22. javier

    Hi Nelson, I appreciate your tutorials, they are really helpful and well done. In this particular tutorial the grid is aligned perfectly in Firefox and Chrome but it has only 3 columns. In Safari the grid also appears in 3 columns and the grid alignment is off. The weird thing is that I have 2 blog modules set up the same way but getting the feed from 2 categories. Your code works perfectly in one module but not in the other. I placed the code for the alignment in the page settings. What am I missing? thanks so much in advance.

    Reply
  23. Ste

    Hi, thank you for this! So simple and great.

    I’m having an issue with older entries. When I set the layout for 8 posts (I’m using 4 columns), the content is skipping some columns. When I use only 4, the “older entries” button doesn’t work. Do you have any ideia to help me with?

    Reply
      • Ste

        That’s right: the older entries button appears, but when I click it doesnt work properly. The link is this one

      • Hemant Gaba

        I am afraid that I am not able to see any older entries button. Could you please share the exact URL where the issue is happening for us to investigate further?

      • Hemant Gaba

        You want the 4 column layout so for that could you please remove the code given above and place this code instead and see if that helps?

        .pa-blog-image-3-4 .et_pb_ajax_pagination_container {
        display: flex;
        flex-wrap: wrap;
        }

        .pa-blog-image-3-4 .et_pb_ajax_pagination_container article{
        width: 23%;
        margin-right: 2%;
        }

        @media all and (max-width: 980px){
        .pa-blog-image-3-4 .et_pb_ajax_pagination_container article{
        width: 48%;
        margin-right: 2%;
        }
        }

        @media all and (max-width: 600px){
        .pa-blog-image-3-4 .et_pb_ajax_pagination_container article{
        width: 100%;
        }
        }

        This will give you 4 columns for the desktop, 2 columns for tablets, and one column for the mobiles. Please let us know if that helps.

  24. Arvie

    Hi Nelson,

    Again this is a great and simple tutorial vs the rest out there.

    Just one question. How can I make the blog image 0 padding while the content has around 10px padding?

    Reply
    • Hemant Gaba

      Please try using this CSS Code and let us know if that helps.
      /*This snippet is for the design*/
      .et_pb_posts .et_pb_post {
      background: #f2f2f2;
      border-radius: 10px;
      -webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */
      page-break-inside: avoid; /* Firefox */
      break-inside: avoid; /* IE 10+ */
      }

      /*This snippet is for making the padding of the image zero*/

      .et_pb_posts .et_pb_post a:first-child{
      padding: 0px;
      }

      /*This snippet is for providing 10px padding to all the other elements*/

      .et_pb_posts .et_pb_post a ~ *{
      padding: 10px;

      }

      Reply
  25. UTBa

    Hi, can you tell me how to keep the size of those columns same please.

    Reply
    • Hemant Gaba

      Please add this code and see if that helps:

      .et_pb_posts .et_pb_post {
      min-height: 620px;
      }

      You can change the value of min-height as per your liking and this will equalize the height of all the posts. Let us know if that helps.

      Reply
  26. Rogier

    Hi, I used this solution multiple times, always work fine. Now I have a site that need pagination at the end of the page. But because of the 2 columns the pagination is placed after the last post in the second column. Is there a way to place the pagination under the two columns?

    Reply
    • Hemant Gaba

      Could you please share the URL of the page where the blog module is present for me to investigate further?

      Reply
  27. Steve Wiseman

    Hi, I used this code along with the ‘turning the read more text to a button’ and I came up with a few issues. Firstly I wanted to use a box shadow on my posts but making the blog full width means the shadow goes round the whole module and not the posts.

    Also when there are an odd number of posts (I had a 2 column grid) the button animation alters the order of the posts and pushes them around when you hover over them.

    Reply
    • Hemant Gaba

      Hi Steve,
      Could you please elaborate on what you are trying to achieve and provide the URL of the page for me to understand the scenario properly and investigate further?

      Reply
      • Stephen Wiseman

        Hi, Thanks for responding. Here’s the URL:

        https://yourcomplete.co.uk/blog/

        What I would like is for the box shadow to go around the posts and not the whole module. (its seems you can achieve this with a border but not a shadow?!)

        Also when you hover over the buttons they appear the get bigger by a pixel or two and that looks like its pushing the order of the blog posts around.

        Thanks for any help!

      • Hemant Gaba

        Hi Stephen,

        I guess the mentioned points of yours are resolved now as the button and the box-shadow on the articles are looking fine.
        Please let us know if you need any further assistance.

    • Hemant Gaba

      Hi there,

      Could you please elaborate on the end result that you are trying to achieve for my better understanding?

      Reply
  28. Kristi

    Unfortunately, none of these codes work for me. I’ve cleared my cache, downloaded your child theme, and tried everything. But when I paste it in CSS some red boxes pop up in the code that say “Unexpected”

    Not sure what to do with that.

    Reply
    • Hemant Gaba

      Please make sure that you are placing the code inside the Blog Module Settings > Advanced Tab > Custom CSS > Main Element Panel.

      Reply
  29. Nicola

    Hello.
    As a newbie, I have found your resources very useful. Thanks.
    I have implemented this, and while it works great on Chrome, it’s not aligning to top on second column on my new iPad. Any ideas? My site is not live so I cannot link to show you!
    Would appreciate a response if you can.
    Best wishes, Nicola

    Reply
    • Hemant Gaba

      Hi Nicola,

      I am afraid that it is required to have a URL in this problem as first I need to check on my end and see if I can replicate the same issue as well or not and then investigate the problem further so could you please live the website and share the URL so that we can investigate further?

      Reply
    • Hemant Gaba

      Hi Chuck,

      Thank you for addressing the issue. We will look into the problem and will get back on this shortly.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Asset 7

Shop Our Divi Products

Plugins • Courses • Templates

Visit The Shop

Divi Adventure Club Product And Course Membership by Pee Aye Creative

Become A Member!

Gain access to everything we offer!

Learn More

Divi Tutorials On YouTube

Our videos have views! Join subscribers and enjoy over video tutorials!

Visit Our Channel

Recent Posts

Pin It on Pinterest

0

Your Cart