Last update: February 10, 2021

How to style the terms in a WP-Grid-Builder grid

Here is a little tip to set a different color for each term in a grid made with the plugin WP Grid Builder (aff link).

There are 2 different ways, as there are 2 methods to build a grid with WP Grid Builder.

With a card made with WP Grid Builder

Method 1

The easiest and fastest way. We just have to enable the Term Colors option:

Then we go to the category settings and we can have a different color for each category :

Method 2

We can do it with some custom CSS, which mean we can not only change the color but also the weight, font and so on.

If we check the code, we will see a data attribute "data-id" , with a unique number for each different term :

We can now style each term by using this data attribute in CSS :

#shortcode-8-1004 .wp-grid-builder .wpgb-block-term[data-id="5"] {
#shortcode-8-1004 .wp-grid-builder .wpgb-block-term[data-id="6"] {

It's what you can see in the OXYGEN4FUN homepage.

With a grid made with the Repeater

If you use the Repeater element to build your grid, it's easier as there is no custom CSS to add.

Instead of adding the category only one time, we add them several time (OXYGEN4FUN has 3 categories, so I add them 3 times).

Each category has his own color:

And for each of them, we set a different condition.

It's what you can see here :

  • All
  • Tutorials (71)
  • Tips (12)
  • Resources (6)

How to use Swiper with Oxygen


A better mobile menu with Mmenu


How to create your own Animated Headings animation with GSAP


How to animate a text along a path


How to add some reveal animations to your elements


How to add a Lightbox to the Gutenberg Gallery Block


How to create a justified gallery


How to animate a Grid that uses the facet from WP-Grid-Builder


Don't forget to check this tutorial if you want to learn more about how to use this plugin with Oxygen.