Getting WordPress Lists to Span Columns Automatically

Amanda Lucas
on
November 25, 2022

Working on a client project recently and managed to get this working - its a simple solution but effective.

screenshot of gutenberg post

Working on a client project recently and managed to get this working – its a simple solution but effective.

Add the following CSS to your stylesheet. I use WPCodebox because it’s incredible but you can simply add to the customiser in WordPress.

/* making list span 2 columns in GB */
ul.\32 -col {
   column-count: 2;
}

@media (max-width: 768px) {
  ul.\32 -col {
   column-count: 1;
}
}

In your post, add a class to the list level element. I added ‘2-col’.

You can change this to suit your needs by adjusting the column-count property in the CSS, but that’s it!

I hope you find this useful.

Leave the first comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Amanda Lucas

Amanda Lucas

Amanda Lucas runs a web design agency in Ireland called Itchy Fingers Design. She enjoys creating websites that help support business goals and growth and sharing her knowledge.