Skip to main content
All CollectionsTroubleshooting and FAQsFrequently Asked QuestionsBlog Module
How to Add Icons to Divi Blog Posts Based on Their Categories
How to Add Icons to Divi Blog Posts Based on Their Categories

Learn how to add category-specific icons to Divi blog posts, which will enhance your site's visual appeal and improve user navigation.

Updated over 4 months ago

Customizing your Blog Module by displaying an icon for each post based on the category it has been assigned to can significantly enhance its visual appeal and user experience.

This helps visually distinguish different types of content and makes navigation easier for your readers.

Create Post Categories

Note: If you already have a bunch of Post Categories created and Posts are already assigned to those categories, you can skip this step.

  1. Go to WordPress Dashboard → Posts → Categories

  2. In the left column, create the new category

  3. Click on the Add New Category button

    WordPress create a new category

  4. Take note of each Category's Slug:

    WordPress Categories Slug

  5. Edit the Page which contains the Blog Module and open the Blog module's settings by clicking on the Gear icon

  6. Go to Advanced Tab → Custom CSS → Free Form CSS and add this CSS code:

    selector .et_pb_post[class*="category-"] .entry-title {
    position: relative;
    padding-left: 34px;
    }
    selector .et_pb_post[class*="category-"] .entry-title::before {
    font-size: 24px;
    font-family: 'ETmodules';
    position: absolute;
    left: 0;
    top: 0px;
    color: #73c32e;
    }

    selector .et_pb_post[class*="news"] .entry-title::before {
    content: "\e059";
    }
    selector .et_pb_post[class*="landscape"] .entry-title::before {
    content: "\e04e";
    }
    selector .et_pb_post[class*="houses"] .entry-title::before {
    content: "\e05a";
    }

Notes:

  1. In the CSS Code above, you will have to replace the news, landscape, houses with your own categories slug text.

  2. When using the above CSS code, the Dynamic Icons option from the Divi → Theme Options → Performance tab should be disabled.

  3. Each icon is defined based on this code content: "\e059". You can get the code for all icons here.

The result can be seen in the screenshot below:

Blog module with custom icons for each Post based on its category
Did this answer your question?