Add Social Icons Widget to Blogger

Discover how to add a CSS-based social media icon widget for Blogger. Include Facebook, Twitter, YouTube, GitHub, and LinkedIn icons to boost engageme
Add Social Icons Widget to Blogger
Add Social Icons Widget to Blogger

Add Social Icons Widget to Blogger

Hello, fellow bloggers! How's everything going? I hope you're all doing fantastic and making great progress with your blogs. Social media widgets are an incredible tool for connecting with your audience and encouraging interactions from visitors.

In this guide, we're diving into adding a social media icon widget for Blogger. This widget is purely CSS-based, so it won't impact your blog's loading speed at all. You'll get sleek icons for Facebook, Twitter, YouTube, GitHub, and LinkedIn that look absolutely stunning.

Let's jump right into the installation process.

View Demo

Why Add a Social Media Icon Widget to Your Blogger Blog?

Before we get technical, let's talk about the benefits. A social media icon widget for Blogger helps drive traffic to your profiles, increases follower counts, and boosts overall engagement. It's a simple way to make your blog more interactive and professional-looking. Plus, since it's lightweight and CSS-only, it keeps your site speedy, which is crucial for SEO and user experience.

Backup Your Blog Template First

Safety first! Before making any changes, always back up your Blogger template. Head to your Blogger dashboard, go to Theme > Backup/Restore, and download your current template. This way, if anything goes wrong, you can easily restore it.

Step-by-Step Guide to Adding the Social Media Icon Widget

Installing this widget is straightforward. We'll use Font Awesome for the icons, add some CSS for styling, and insert an HTML widget in your layout.

Step 1: Add Font Awesome to Your Template

Font Awesome provides the icons we need. Go to your Blogger dashboard, select Theme > Edit HTML. Search for the </head> tag and paste this link just above it:

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">  


This connects your blog to the icon library without any performance hit.

Step 2: Add the CSS Code for Styling

Next, we'll style the icons to make them look fabulous. In the Edit HTML section, find the ]]></b:skin> tag and add this CSS just before it:

      <style>
    /* Reset & Base Styles */
    * {
      box-sizing: border-box;
    }
    *:focus, *:active {
      outline: none !important;
      -webkit-tap-highlight-color: transparent;
    }
    
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background-color: #f4f7f6; /* Light background to make shadows pop */
      margin: 0;
    }

    /* Modern Flexbox Container */
    .wrapper {
      display: flex;
      justify-content: center;
      gap: 20px; /* Replaced margin with gap for cleaner spacing */
    }

    /* Icon Container Styling */
    .wrapper .icon-container {
      position: relative;
      width: 55px; /* Slightly larger for better touch targets */
      height: 55px;
      background-color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 16px; /* Smoother 'squircle' shape */
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); /* Softer, more modern shadow */
      cursor: pointer;
      font-size: 24px;
      text-decoration: none;
      overflow: hidden;
      transition: all 0.3s ease; /* Smooth transition for the container */
    }

    /* Hover Lift Effect */
    .wrapper .icon-container:hover {
      transform: translateY(-5px); /* Button lifts up slightly on hover */
      box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15); /* Shadow expands when lifted */
    }

    /* Background Fill Animation Elements */
    .wrapper .icon-container::before {
      content: "";
      width: 120%;
      height: 120%;
      position: absolute;
      top: 90%;
      left: -110%;
      transform: rotate(45deg);
      transition: all 0.4s cubic-bezier(0.31, -0.105, 0.43, 1.59); /* Slightly slower for elegance */
      z-index: 1;
    }

    /* Icon Scaling Animation */
    .wrapper .icon-container .icons {
      transform: scale(0.8);
      transition: all 0.4s cubic-bezier(0.31, -0.105, 0.43, 1.59);
      z-index: 2;
    }

    /* Brand Colors (Default State) */
    .wrapper .icon-container.facebook { color: #3b5998; }
    .wrapper .icon-container.twitter { color: #1da1f2; } /* Updated to newer Twitter blue */
    .wrapper .icon-container.youtube { color: #ff0000; } /* Updated to pure YouTube red */
    .wrapper .icon-container.github { color: #1b1f23; }
    .wrapper .icon-container.linkedin { color: #0a66c2; } /* Updated to newer LinkedIn blue */

    /* Hover States - Icon Color Change */
    .wrapper .icon-container:hover .icons {
      color: #ffffff;
      transform: scale(1); /* Pops back to full size */
    }

    /* Hover States - Background Fill */
    .wrapper .icon-container:hover::before {
      top: -10%;
      left: -10%;
    }

    /* Brand Colors (Hover Fill State) */
    .wrapper .icon-container.facebook:hover::before { background-color: #3b5998; }
    .wrapper .icon-container.twitter:hover::before { background-color: #1da1f2; }
    .wrapper .icon-container.youtube:hover::before { background-color: #ff0000; }
    .wrapper .icon-container.github:hover::before { background-color: #1b1f23; }
    .wrapper .icon-container.linkedin:hover::before { background-color: #0a66c2; }
  </style>       

This code creates circular icons with hover effects, enhancing the visual appeal of your social media icon widget for Blogger.

Step 3: Add the HTML Widget in Layout Mode

Now, go to Layout in your dashboard. Click "Add a Gadget" in the sidebar or footer where you want the widget. Choose "HTML/JavaScript" and paste this code:

     <div class="wrapper">
    <a href="#" target="_blank" class="icon-container facebook" aria-label="Facebook">
      <i class="icons fab fa-facebook-f"></i>
    </a>
    <a href="#" target="_blank" class="icon-container twitter" aria-label="Twitter">
      <i class="icons fab fa-twitter"></i>
    </a>
    <a href="#" target="_blank" class="icon-container youtube" aria-label="YouTube">
      <i class="icons fab fa-youtube"></i>
    </a>
    <a href="#" target="_blank" class="icon-container github" aria-label="GitHub">
      <i class="icons fab fa-github"></i>
    </a>
    <a href="#" target="_blank" class="icon-container linkedin" aria-label="LinkedIn">
      <i class="icons fab fa-linkedin-in"></i>
    </a>
  </div>     

Replace the placeholders with your actual profile URLs. Save the gadget, and you can drag it to any position in your layout.

Customizing Your Social Media Icons

Feel free to tweak the CSS! Change colors, sizes, or add more icons like Instagram (use .fa-instagram). Experiment in the template editor and preview changes. This flexibility makes the social media icon widget for Blogger perfect for matching your blog's theme.

Troubleshooting Common Issues

If icons don't show, double-check the Font Awesome link. For alignment problems, adjust the CSS margins. If you encounter errors, restore your backup and try again.

Conclusion

There you have it! You've successfully added a social media icon widget for Blogger to enhance visitor interactions. This quick setup can significantly improve your blog's connectivity.

If you run into any issues or have questions about adding social media icons to Blogger, drop a comment below. Like and follow our blog for more tips on Blogger, SEO, HTML, CSS, YouTube, thumbnails, and templates.

Post a Comment