Add Instagram Color Gradient to Social Media Follow Module

Written by Dan Mossop

The Divi theme comes with a Social Media Follow module which lets you add icons for various social networks, including Instagram. By default, the Instagram icon has the old-style red background. If you'd rather use Instagram's newer yellow / purple color gradiant for the background, this post explains how.

Adding a Background Gradiant to the Instagram Icon

First, let's look at the case where we change the background of the instagram icon, like so:

Before
After

Changing the Instagram Background with CSS

The Instagram background can be changed relatively easily by pasting some CSS into the Social Media Module.

First, here's the CSS:

background: radial-gradient(circle farthest-corner at 35% 90%, #fec564, transparent 50%), radial-gradient(circle farthest-corner at 0 140%, #fec564, transparent 50%), radial-gradient(ellipse farthest-corner at 0 -25%, #5258cf, transparent 50%), radial-gradient(ellipse farthest-corner at 20% -50%, #5258cf, transparent 50%), radial-gradient(ellipse farthest-corner at 100% 0, #893dc2, transparent 50%), radial-gradient(ellipse farthest-corner at 60% -20%, #893dc2, transparent 50%), radial-gradient(ellipse farthest-corner at 100% 100%, #d9317a, transparent), linear-gradient(#6559ca, #bc318f 30%, #e33f5f 50%, #f77638 70%, #fec66d 100%);
Note: CSS sourced from this StackOverflow post.
Now go to:

Social Media Follow Settings > Social Network Settings {for your Instagram icon} > Advanced > Custom CSS > Social Icon

And paste in the CSS above like so:

Now Save and view your page. If all is well, you should now see the gradient effect on your Instagram icon.

Adding a Foreground Gradiant to the Instagram Icon

Now, let's look at the case where we change the color of the instagram icon itself, not the background. i.e:

Before
After

Changing the Instagram Icon Color with CSS

The Instagram foreground can be similarly changed by pasting some CSS into the Social Media Module.

In this situation, we need some different CSS, and unfortunately this CSS can't be applied via the module's Custom CSS fields. Instead we can add it into the "Divi > Theme Options > General > Custom CSS" box, from where it will be applied to all usage of the Instagram icon in the social media module site-wide.

.et_pb_social_media_follow .et-social-instagram a.icon {
    background-color: #fff0 !important;
}
.et_pb_social_media_follow .et-social-instagram a.icon:before {
    background: radial-gradient(circle farthest-corner at 35% 90%, #fec564, transparent 50%), radial-gradient(circle farthest-corner at 0 140%, #fec564, transparent 50%), radial-gradient(ellipse farthest-corner at 0 -25%, #5258cf, transparent 50%), radial-gradient(ellipse farthest-corner at 20% -50%, #5258cf, transparent 50%), radial-gradient(ellipse farthest-corner at 100% 0, #893dc2, transparent 50%), radial-gradient(ellipse farthest-corner at 60% -20%, #893dc2, transparent 50%), radial-gradient(ellipse farthest-corner at 100% 100%, #d9317a, transparent), linear-gradient(#6559ca, #bc318f 30%, #e33f5f 50%, #f77638 70%, #fec66d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fff0 !important;
}

Once added, it should override the colors set within the social media module.

Note: This CSS code won't work with Internet Explorer, which will instead show the gradient as a background, similar to the effect shown earlier in this post.

Note: If you'd like to apply the effect only on hover, use this CSS instead: 

Hover-only version:

.et_pb_social_media_follow .et-social-instagram a.icon:hover {
    background-color: #fff0 !important;
}
.et_pb_social_media_follow .et-social-instagram a.icon:hover:before {
    background: radial-gradient(circle farthest-corner at 35% 90%, #fec564, transparent 50%), radial-gradient(circle farthest-corner at 0 140%, #fec564, transparent 50%), radial-gradient(ellipse farthest-corner at 0 -25%, #5258cf, transparent 50%), radial-gradient(ellipse farthest-corner at 20% -50%, #5258cf, transparent 50%), radial-gradient(ellipse farthest-corner at 100% 0, #893dc2, transparent 50%), radial-gradient(ellipse farthest-corner at 60% -20%, #893dc2, transparent 50%), radial-gradient(ellipse farthest-corner at 100% 100%, #d9317a, transparent), linear-gradient(#6559ca, #bc318f 30%, #e33f5f 50%, #f77638 70%, #fec66d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fff0 !important;
}

Enhance Your WordPress Site with AI-Generated CTAs

Transform your WordPress site with WP Magic CTAs. This AI-driven plugin generates custom, targeted calls-to-action for each post, boosting engagement and conversions. Ideal for directing your audience to offers or growing your mailing list.

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.

Latest Posts

Set Custom CSS IDs for Individual Divi Accordion Items

Assigning unique CSS IDs to specific Divi Accordion items allows for precise control over styling, targeting, and linking within your page content. This ability is particularly useful when you want to apply custom designs or create anchor links to particular accordion...

Enable Swipe Navigation in the Divi Gallery Lightbox

Enabling swipe navigation in the Divi Gallery module's lightbox allows users to seamlessly browse through gallery images by swiping left or right, creating a more interactive and mobile-friendly experience. This functionality can significantly improve user engagement...

Disable Slide-In Animation for Divi Gallery Grid Images

Control how images appear in your Divi Gallery module by toggling the slide-in animation effect for grid layouts. Disabling the slide-in animation allows gallery images to load instantly and appear statically, providing a faster and distraction-free browsing...

Control Image Count Display in Divi Gallery Lightbox

Displaying or hiding the image count in the Divi Gallery module’s lightbox can help customize the user experience, depending on whether you want to give visitors an indication of gallery progress or prefer a cleaner, distraction-free view. The ability to toggle this...

Hide Gallery Image Titles in the Divi Lightbox Overlay

Displaying image titles in the lightbox overlay of the Divi Gallery module can sometimes be distracting or unnecessary, depending on your website’s design and user experience goals. Hiding these titles creates a cleaner and more focused viewing experience for visitors...

Random Posts