Divi comes pre-packaged with a selection of icons which can be used with modules such as the blurb module. These icons are 'font icons' provided by Elegant Themes and there is no in-built way to add new fonts. Fortunately, there is a way we can work around this to add our own custom icons.
Note: this post is about uploading your own image icons for use in Divi modules. See here if you want to add more social icons in the Divi header / footer. Alternatively, see here if you specifically want more icons in the Social Media Follow Module.
Adding Custom Icons using Divi Booster
The Divi Booster plugin adds a wide range of new features to Divi, including the ability to add new icons to the list of built-in icons. This makes them easily available to your modules, with no need to upload the image each time you want to use it. The icons will be available in modules which normally have the option to add an icon, such as the blurb and button modules.
To add custom icons using Divi Booster:
- Go to the Divi Booster settings page
- Open the 'Site-wide Settings' toggle
- Open the 'Icons' sub-toggle
- Tick the checkbox next to the 'Add custom icons for use in modules' option to enable the feature.
- Click on the '+' symbol to add an existing image icon from the media library or upload a new one.
The option should now look something like this:
To remove an icon, hover over it and click on the trash can 'delete' icon that appears over it. Click the '+' symbol again to add more icons. If you want to add an icon by URL, close the media library and paste your icon's url in the 'url' field immediately below the icon.
Save the Divi Booster settings and your icon will now be available to you in the modules icon list.
Note: to use SVGs, add SVG support to WordPress with a plugin such as SVG Support.
Styling the Custom Icons
It'll depend slightly on which module the icons are being used in, but in general the size can be set in the same way as the rest of the icons. Similarly, the background should work as long as your icon image has a transparent background itself. Changing the icon color is a different matter. The built-in icons are 'font icons', meaning they are basically text, while the icons added in that Divi Booster option will be images. This means that the settings for changing the color of the built-in icons won't work on the added image icons. I hope to be able to add something in the future (probably along the lines of the filter options Divi includes for the entire module area). I'll update here if / when I'm able to. In the meantime, the best I can suggest is to modify the colors of your icons in an image editing program prior to uploading.
Compatibility with Third-Party Modules
In addition to working with the built-in Divi modules, this feature will work with many third-party Divi modules. While it will usually work without modification, some plugins will need a bit of extra work to ensure they are compatible. If you encounter a case where the custom icons aren't working on a particular module / field, please let me know.
Hi. I'm having an issue where the custom icons in the Blurb module no longer are circled. Built-in icons do show circled but the custom ones don't. I've tried both png and svg custom icons.
Hey Brian, I’ve just released a fix (v3.2.6) that I think should resolve this. I hope it helps but if not, are you able to share a link to a page showing the issue? Thanks!
Hello, just downloaded Divi Booster, having the same issue with icons. Following the instructions, but it doesn't work, I do not see any of my icons added. What can I do ?
Hi Magdalena, the first thing to rule out is any caching issues – i.e. that the site is still showing an old version of the page. Try clearing any caches used on your site, and your browser cache. That should get the latest version of the page showing. If that doesn't help, is there any chance you're able to share a link to the page you're working on (either here or via the contact form)? If you can also let me know where on the page you're adding the icons (i.e. which module), that would be great. Thanks!
Hey Patrick, I can't use more than 10 icons. There are more than 10 icons displayed in the booster settings and I can also see and select them in the Blurb module, but they are then not displayed. Instead, all Divi icons are displayed at once. Can you help me? Thank you and greetings Carsten
Hey Carsten, I just ran a test with 20 custom icons and they display correctly for me. Is there any chance you're able to share a link to an example page showing the problem? There may be something going on that I'm missing. Thanks!
Hey, Dan, I am running to an issue implementing the custom icons where the icons appear to be shifted up compared to the base Divi icons. It seems to be the margin-top: -16px on the img tag in the element inspector. Any help would be appreciated.
Applying the following CSS in the "Divi>Theme Options>General>Custom CSS" appears to have resolve the issue temporarily.
img.dbdb-custom-icon-img {
margin-top: 0px;
}
Hey Matthew, I'm glad you've found a workaround. I'm not quite sure what was adding that negative margin-top. Is there any chance you're able to share a link to the page you've been working on? I'd love to take a look and see if I can figure out where it came from / how to solve it permanently. Thanks!
I tried the php solution but am just getting a group of 6 standard icons together in the blurb icon selector.
I have used this code in my child theme functions.php file:
[data-icon="myicon"]::before {
background: url('https://www.leodisdiamonds.co.uk/wp-content/themes/divi-child/icons/select_stone.svg');
content:'a' !important;
width:16px !important;
height:16px !important;
color:rgba(0,0,0,0) !important; }
jQuery('.et-pb-icon').filter(function(){ return jQuery(this).text() == 'myicon'; }).html(");
The code in the post was lagging a bit behind the code used in Divi Booster which has already been updated to address both the icon picker "6 icons" issue and to add SVG support, so I've updated the post with the code from the latest version of Divi Booster. It's quite a bit longer than the original as it handles more edge cases and does some heavy lifting to keep the visual builder preview updated. But as I say in the post, you can basically ignore all of it but the last line. Hope it helps!
Hello,
I tried the php solution, but this code add a group of 6 icons glued together (6 icons that are in the standard set already).
Could you help me to use your functions?
Caroline
Hi Caroline, probably what you're seeing is the "myicon" placeholder rendered in the standard icon divi font. This means that the javascript code added by the final PHP code is not taking effect correctly. Is there any chance you're able to point me to an example page showing the problem so that I can take a look? Thanks!
Hi, I've added svg icon with Divibooster, the icon appears in the module icon list, but when I select it's smaller than other icons (I've added svg icon at 96/96px) and not positionned as wel as other.
Hi Arno, is there any chance you're able to send me a link to the page you're working on so that I can take a look for you? If that's not possible, perhaps you can send me a screenshot? (Note: if you submit a bug report via the contact form you'll get an auto-response email to which you can attach the screenshot). Thanks!
Don't work for SVG.
Even with SVG safe plugin, i cannot change color… because is a img with Divi booster :(
Hi Funfrock, while you should be able to upload and display SVG icons, you're right – you can't change the color because the icons added via Divi Booster are image files. The built-in Divi icons are added using an icon font, which can be styled in the same way as other text fonts. But images can't be changed in the same way since they contain their own color information, for example, and CSS text colors set on them are ignored. There are some new options for changing image colors using CSS filters, but they are a bit complex (see this StackOverflow answer for example). The easier alternative, if you can use it, is to change the color of the image in an image editor, before uploading it to Divi Booster. I hope to be able to add support for color changing using CSS filters in the future. Thanks!
Hi, I was trying to ad the icons but it is show as a gray square , what could be the problem?
Hey jesus, any chance you're able to send me a link to the page you're working on so that I can take a look for you? Thanks!
Hi Dan, I just uploaded a 96X96 icon in the divi booster settings page, shows up in the blurb icon settings in the builder but when I select the new uploaded icon, it does not show up on the builder web page…what am I doing wrong….wp is up to date and divi theme as well.
I tried changing the icon color and and back ground, circle as well but still can't see it
Hi Charles, it looks like Divi has made a change which is preventing the icons from displaying in the blurb module preview. The icons should still show up correctly on the site itself (i.e. if you view / preview the page). I've had a look and there doesn't seem to be an easy way to get the icons working in the preview again, so I'll need to spend some more time on that. I'll try and get them working again as soon as I can. I hope it doesn't inconvenience you too much, and like I say, the icons should still display correctly on the site itself. If you find that isn't the case for you, please let me know. Thanks!
Hello , i am new to this so im not sure what code i should put for that "We then use CSS to set our small icon as the background for the icon selection button and use some CSS / jQuery to make it display correctly." Can you please help me sir ?
Hi maucikk, this is actually just describing what the PHP code in the "Adding Custom Blurb Icons Manually" section does. There's nothing else to add – instead, the PHP code adds the CSS and jQuery code for you. I've updated the text to hopefully make this a bit clearer. But let me know if you have any questions, etc. Thanks!
Hi – I tried this script to add a whatsapp icon for a button. The new icon appears at the end of the list correctly and has the next sequential number: %%380%%
The problem I have is that it when I select it as the button icon (left) it just displays a mess of icons over the top of the button text. Any idea what the problem is?
Hey patrick, the code above gives an example of using the icons with the Blurb module. The Button module uses different HTML and CSS and must be treated differently. I think you should be able to get your button showing just by unhiding that mess of icons (so that you can see it again) and adding this CSS to the site:
You might still want to do a bit of tweaking to get the positioning, etc, right (let me know if you need any help), but I think that should at least get the icon showing for you.
Can I use SVG icons?
Hi Dieter, by default Wordpress doesn't support SVG icons, so initial attempts to use them to fail. However, you can enable SVG support in Wordpress with a plugin such as the free SVG Support plugin (https://wordpress.org/plugins/svg-support/). Once active you should be able to use SVG icons as your custom icons (either with the code above or with Divi Booster). I hope that helps.