Use Dynamic Content on Divi Icon Settings

Written by Dan Mossop

Divi's Dynamic Content feature is really useful for inserting details into your Divi layouts / templates. However, it doesn't include support for icons. If you'd like to be able to use dynamic content on the icon pickers in your Divi modules, here's how you can.

Enabling Dynamic Content on Icon Fields using Divi Dynamic Content Extended

Divi Dynamic Content Extended extends Divi's dynamic content with new fields and data sources. One of it's features is that it adds the ability to select icons using Dynamic Content. Here's an example of how to use it with a standard WordPress custom field:

Step 1: Set the Icon Code in a Custom Field

Open your post / page for editing in the post editor screen in WordPress.

Click on the three vertical dots at the top-right corner to open the options menu.

Click on the "Preferences" menu item.

 In the "Preferences" popup, click to enable "Custom Fields".

Now click the "Show & Reload Page" button.

The Custom Fields box should now be visible below the post editor. Enter a 'Name' for your custom field. Here we'll use 'icon_code'. The name itself doesn't matter too much, but you should use the same name on any other posts which use the same template. Then enter the code for the icon you want to use in the 'Value' field. The icons and their codes are listed on Elegant Themes' Elegant Icon Font post. Here we'll use the code for a checkmark:

N

If you instead want to use a font awesome icon, you can use any of the font-awesome icons available by Divi's icon picker by specifying it like so:

||fa

You can find the icon code for a font-awesome icon by inspecting the icon in the browser and looking for the "data-icon-utf" attribute on the icon element.

Click "Add Custom Field" to add the field to the post.

 Now "Update" the post to save your custom field to the post.

Note: You can streamline the creation of custom fields using the Advanced Custom Fields plugin.

 

Step 2: Select the Custom Field in the Module

Open your post / page in the visual builder

Open the settings for the module you wish to use the dynamic icon on.

Locate the setting with the icon picker, and hover over it to reveal the dynamic content icon added by Divi Dynamic Content Extended.

 Click on the dynamic content icon.

The dynamic content menu should now appear, with your custom field available as one of the options. Click on your custom field.

 You should now see that your icon field has been set to take the value from your custom field.

 Save the module settings.

Step 3: View the Result

In the visual builder preview you'll see the 'dynamic content' icon used as a placeholder for your custom field icon. On the front-end, this will be replaced by the icon configured in your custom field.

Save the post / page to confirm your changes.

Now view your page on the front-end.

You should now see your custom field icon displayed on the module.

Dynamic Content for Icons was added in Divi Dynamic Content Extended v1.2.1.

Enhance Dynamic Icon Usage with Divi Dynamic Content Extended

Take your Divi layouts to the next level by enabling dynamic content for icons! With Divi Dynamic Content Extended, you can utilize custom fields to choose icons dynamically, enhancing flexibility and design capabilities on your site.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

We may earn a commission when you visit links on our website.