How come the Font Awesome icon is not displaying on every single page?

Adding an RSS icon font to the list of ways to connect on a WordPress website turned out to be a bit tricky. Even though SVG icons worked perfectly for other links in the sidebar widget, the RSS icon just wouldn't cooperate. After trying different approaches, including using an icon font and Font Awesome, the issue still persisted.

The connect with us widget is supposed to appear on all pages in the sidebar. However, there were instances where the font image didn't display at all or appeared misaligned compared to other icons. You can see examples of these discrepancies on the "Follow Us" widget at: and .

Furthermore, on certain pages like the Gallery page, an extra icon unexpectedly made its appearance. In an attempt to address this, a test widget was created featuring rss and rss-square icons. Though it has been removed, remnants of this experiment continue to linger on one specific page. Check out the sidebar and bottom of the same page here:

A snippet of the HTML code that somewhat works is

<div class="sidebar-social-navigation">
    <ul class="social-icons element">
        <li><a href="https://www.facebook.com/baeeorg" style="-moz-user-select: none;"><span class="screen-reader-text">Facebook</span><svg class="icon icon-facebook" aria-hidden="true" role="img" title="Facebook"> <use href="#icon-facebook" xlink:href="#icon-facebook"></use> </svg></a></li>
        <li><a href="https://www.flickr.com/photos/baee/15449796790/" style="-moz-user-select: none;"><span class="screen-reader-text">Flickr</span><svg class="icon icon-flickr" aria-hidden="true" role="img" title="Flickr"> <use href="#icon-flickr" xlink:href="#icon-flickr"></use> </svg></a></li>
        <li><a href="https://www.pinterest.com/baee0196/" style="-moz-user-select: none;"><span class="screen-reader-text">Pinterest</span><svg class="icon icon-pinterest-p" aria-hidden="true" role="img" title="Pinterest"> <use href="#icon-pinterest-p" xlink:href="#icon-pinterest-p"></use> </svg></a></li>
        <li><a href="https://www.twitter.com/BaeeArtists" style="-moz-user-select: none;"><span class="screen-reader-text">Twitter</span><svg class="icon icon-twitter" aria-hidden="true" role="img" title="Twitter"> <use href="#icon-twitter" xlink:href="#icon-twitter"></use> </svg></a></li>
        <li class="element"><a href="https://www.botanical-art.baeecorp.org/feed" aria-label="RSS"><span class="screen-reader-text">RSS</span><i aria-hidden="true" data-prefix="fas" data-icon="rss" role="img" xmlns="http://www.w3.org/2000/svg" class="rss fa fa-rss fa-2x" style="font-size: 28px;"></i></a></li>
    </ul>
</div>

Here's the CSS used for the SVG icons:

.sidebar-social-navigation {
    margin: 0 0 -8px 0;
    padding: 0;
}

.sidebar-social-navigation ul.social-icons {
    list-style: none;
    margin: 0;
    padding: 0;
}

.social-icons .element {
  position: relative;
  display: inline-block;
}

.sidebar-social-navigation li a:link {
    background-color: #2222ac;  
    -webkit-border-radius: 50px;
    border-radius: 50px;
    color: #fefdff;  
    height: 50px;
    margin: 0 0.5em 0.5em 0;
    text-align: center;
    width: 50px;
}

.sidebar-social-navigation li a:visited {
    color: #fefdff;  
}

.sidebar-social-navigation li a:hover,
.sidebar-social-navigation li a:focus,
.sidebar-social-navigation li a:active {
    background-color: #129e6c;    
}

.sidebar-social-navigation .icon {
    height: 28px;
    top: 12px;
    width: 28px;
    vertical-align: top;
}

Lastly, the additional CSS rules for the FontAwesome icon are as follows:

.social-icons .element a::before {
  content: "";
    font: normal normal normal 28px/1 FontAwesome;
    text-rendering: auto;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    vertical-align: top;
    color: #2222ac;  
    position: absolute;
    margin-right: 5px;
    margin-right: 0.5rem;
    text-align: left;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

ul.social-icons .rss a::before {
    content: '\f09e'; /* curved lines */
}

Answer №1

Add this URL to your Head tags for styling:

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

Now, swap out your SVG icons with the code snippets below:

<i class="fa fa-facebook"></i>
<i class="fa fa-pinterest-p"></i>
<i class="fa fa-flickr"></i>
<i class="fa fa-twitter"></i>
<i class="fa fa-rss"></i>

I hope you find this information useful.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Incorporate periods after text with CSS

After creating an ASP page to showcase events, I decided to limit the content displayed in each item template to three lines using CSS. Now, I am looking to add three periods after the text to signify that there is more content available. I tried using . ...

Utilizing box-sizing for the creation of an internal border

Looking to create an HTML table with clickable cells, each containing a div that adds a border upon clicking. The challenge is ensuring the border stays within the boundaries of the td without altering the size of the table or its cells. Struggling to achi ...

The accuracy of IE9 <section> is not quite up to par

When viewing This Page in IE9, the element section#tcs-website-content appears as 990px wide even though its CSS property is set to width: 100%. This occurs despite all parent elements also having a width of 100%, resulting in a browser width of 1024px. A ...

The bottom CSS property does not function properly on a grid container with a position of fixed

I've created a container that covers the entire screen using the following CSS: .container { display: grid; position: fixed; top: 0; right: 0; bottom: 0; left: 0; } The issue I'm facing is that changing the value of the ...

lxml does not adhere to CSS styling when extracting text from elements

I'm currently experimenting with selenium + chrome in comparison to requests + lxml for web scraping purposes. My main focus is on extracting text data. With selenium + chrome, I can use the following code snippet: element = self.driver.find_element ...

tips for positioning images and text in the center using css classes

Here's what I currently have: http://jsfiddle.net/nCs88/ Here's my goal: As a beginner, I am struggling to center the button images with the text. Any help would be greatly appreciated as this has been frustrating me for hours. ...

Click on the text to be directed to the linked page

I have an interesting issue. I have an image that, when hovered over, displays some text. What I'd like to do is add a hyperlink within that text. For instance, the text might say "hello my name is," and I want to include "click to find out" as a cli ...

Troubleshooting: Layout display issue on Internet Explorer 8

The first image is from IE9 and above, while the second one is from IE8. In IE8, the right side goes down because it's displaying in mobile view (Check the top menu) Here is the header code I am using: <meta charset="utf-8"> <meta h ...

Introducing Filterizr, the innovative gallery filter plugin with a unique mix filter mode

I am currently working on implementing the Filterizr plugin () into my project. I specifically require the mix filter feature as demonstrated on this tutorial page . Upon clicking the mix button, as shown in the screenshots, only orange and purple blocks ...

Not successfully aligning all buttons except for the initial one

HTML code snippet <div class="breadcrumbs row"> <button><a href="#">One</a></button> <button><a href="#">Two</a></button> <h1><button><a href="#">Three</a></button>& ...

jQuery id selector issue: not selecting elements properly

It seems like I am overlooking a very fundamental aspect here. Essentially, there are 2 div elements in the HTML markup. When one is clicked (#x), the other div element (#block1) gains a new class (.change), resulting in a change in its color. The issue ...

Create a login and signup page with HTML, CSS, and JavaScript for seamless user authentication

I followed tutorials on Youtube to create a login and signup page, but I ended up putting all the code in index.html file. Now, I want to separate the login and signup pages into different files, but I'm facing issues with linking them together since ...

Utilizing personalized icons through importing a font in CSS

Looking to incorporate an icon into my CSS using the @import feature from a specific font found on . However, I'm encountering issues with the icon not loading properly. Any suggestions on what might be going wrong here? Thank you in advance! <div ...

What is the correct way to utilize the `<svg>` element when loading external resources?

I have gone through numerous tutorials on how to add external SVGs to a webpage... such as this one: The code I am using looks like this: <svg> <use xlink:href="https://upload.wikimedia.org/wikipedia/commons/5/53/Skull_and_crossbones.svg">& ...

Update the div element without needing to reload the entire page

Is there a way to reload a div tag without refreshing the entire page? I understand this question has been asked before, but I want to make sure I have a clear understanding. <p>click HERE</p> <div class="sample"> <?php functi ...

The CSS outline properties vary between input elements and input elements in focus

I'm encountering an issue with a box and its associated CSS outline style. When the box is focused, it should display a blue outline (which is working fine). However, upon form validation, if there is an error, the .error class is added which should c ...

Select: Exchange icon when clicked

UPDATE MENU ICON jsfiddle.net/a3MKG/83/ Can someone provide guidance on how to change the menu icon image upon clicking it? I would like the icon to switch to a different image (such as an X) once it has been clicked. Please Note: When the menu icon is c ...

Assign a class to the checkbox of the first parent

I have a set of checkboxes generated using a for loop. I want the first checkbox to act as a parent, and all other checkboxes should act as children. When the parent checkbox is clicked, all child checkboxes should be checked. Although I have code to achi ...

Browsed through the CSS impact panels

.Tab1 { background-image: url("http://dl.dg-site.com/wp-content/themes/aeron/images/dl-products-icons5.jpg"); background-repeat: no-repeat; background-position: center; background-clip: content-box; width: 100px; height: 75px; display: block; ...

Prevent text wrapping and clear floats in a clean and hack-free way

I am currently in the process of compiling a collection of blurbs accompanied by images that can be easily integrated into any section of our website. My goal is to ensure that these blurbs are versatile, free from rigid width specifications, and compatibl ...