Social media icons

Ehren

Administrator
Staff member
Customer
All xenfocus styles come with built-in social media icons. To configure them, browse to Style Properties > Xenfocus: Social icons

You'll be presented with options for different locations which can be enabled or disabled.

At the bottom, a text box can be used to enter your social media links. The links must be placed inside an <li> tag, like so:
Code:
<li><a href='https://www.facebook.com/xenfocus' target='_blank'>Facebook</a></li>

If you'd simply like to show a logo instead of text, omit the text entirely like this:
Code:
<li><a href='https://www.facebook.com/xenfocus' target='_blank'></a></li>

Icons are automatically applied depending on the URL, so if the URL contains "facebook", the facebook icon will be shown. If your URL doesn't automatically create an appropriate icon, further css code may be required.


Adding your own social icons

If FontAwesome doesn't have an icon for your social media icon (such as Mastodon), you'll need to use an image icon instead. First, add your HTML code using the same method as above.

Next, add this to your extra.less file, replacing https://testing.com with your URL, and https://site.com/icon.png with the URL to your icon.

CSS:
.xenfocus-social a[href="https://testing.com"]::before{
    background-image: url('https://site.com/icon.png');
    background-size: contain;
    content: '';
    background-repeat: no-repeat;
    background-position: 50%;
    -webkit-mask: none;
    mask: none;
    background-color: transparent;
}
 
Last edited:
For discord, add the following to extra.less and upload the attached image to /styles/xenfocus/images/discord.png

Code:
.xenfocus-social a[href*="discordapp.com"]{
   background-color: #7289da;

   #XF &::before {
       background: url('styles/xenfocus/images/discord.png') no-repeat 50% 50%;
       background-size: 20px auto;
       font-size: 0;
   }
}

The image is below (barely visible) :
discord.png


I'll update the theme files on my demo board and they'll automatically be patched for the next update.
 
I want change colour
Open the xenfocus_theme.less file and delete the following:
Less:
.xenfocus-social a:not(:hover){
    background-color: @xf-xenfocus_breadcrumb--background-color;
    background-image: @xf-xenfocus_breadcrumb--background-image;
    -webkit-backdrop-filter: blur(15px) saturate(130%);
    backdrop-filter: blur(15px) saturate(130%);    
}

.xenfocus-social a:hover::after {
    background: none;
}
 
Hi Ehren,
The only issue so far I have found with this is Pinterest. If using .com it loads the 'P' logo fine, if using .co.uk it loads a generic share button.
Is that easy to rectify?
Many thanks!
 
Hi Ehren,
The only issue so far I have found with this is Pinterest. If using .com it loads the 'P' logo fine, if using .co.uk it loads a generic share button.
Is that easy to rectify?
Many thanks!
Sorry about that. Add this to extra.less and I'll have it patched by default for the next update. :)

Less:
.xenfocus-social a[href*='pinterest.']{
    background: #cd1d1f;
    &:before{ content: "\f0d2"; }
}
 
How can I know the images there are ? for example, will the telegram icon appear ?
The icons are created using fontawesome. If you open the xenfocus_base.less file, you'll see a list of the supported social sites on line 2640. The telegram code starts on line 2743.

If you need to add your own, make sure the code is added to your extra.less file. The xenfocus_base.less file should never be modified.
 
OK at wit's end. Attempting to put bluesky icon within the social media icons.

Social Icon Code:
Code:
<li><a href='https://bsky.app/profile/did:plc:oi4xpamxoz6lfavgv46mrylt/feed/aaafjicp6upmc' target='_blank'></a></li>

Attempting to place my own icon per the above:
Code:
.xenfocus-social a[href="https://bsky.app/profile/did:plc:oi4xpamxoz6lfavgv46mrylt/feed/aaafjicp6upmc"]::before{
    background-image: url('http://www.servicedogadvocate.com/images/bluesky.png');
    background-size: 1em auto;
    content: '';
    background-repeat: no-repeat;
    background-position: 50%;
}

Result is:
1732329382681.png


Should be
bluesky.png

Still seeing the "*" (I think) in white

What am I doing wrong, or is there a different method with the newer releases?
 
Hello @Ehren -- I'm running XenForo 2.3.4 and wanting to add a Tiktok social icon to my forums. I followed your instructions above and it's very close to working.

I downloaded the Tiktok SVG from Font Awesome, converted it to PNG, and saved it to my image hosting.

Then added this to Xenfocus: Social icons:
<li><a href='https://www.tiktok.com/@footballguysofficial' target='_blank'></a></li>

Then I added this to extra.less:

.xenfocus-social a[href="[URL]https://www.tiktok.com/@footballguysofficial[/URL]"]::before{
background-image: url('https://footballguys.imgix.net/forum-images/social/tiktok-icon.png');
background-size: 1em auto;
content: '';
background-repeat: no-repeat;
background-position: 50%;
}

So that background-image-url points to the Tiktok icon I created and posted.

I can see the Tiktok icon in the Social Icons now, but it appears behind the gray box/white asterisk text. Is there a way to remove the asterisk and bring the Tiktok icon to the foreground? Or maybe a different way to surface a Tiktok social icon if this is no longer the best way?

Thanks!

1736961092378.png
 
Last edited:
The image in the icon looks too small, how can I enlarge it?
 

Attachments

  • Screenshot_20260328_052958_Chrome.jpg
    Screenshot_20260328_052958_Chrome.jpg
    80 KB · Views: 85
The image in the icon looks too small, how can I enlarge it?
The social icons weren't really designed to have completely custom images like that (with the overflowing car graphic).

If you're able to send through your URL, I'll do my best to take a look at your icon for you.
 
X icon is missing? Only the old Twitter one is showing on the themes...
The X icon isn't supported by the FontAwesome kit in Xenforo.

But you can use an inline svg instead. Add this to your extra.less file:
CSS:
.xenfocus-social a[href*="/x.com"]{
    background-color: #000;
    padding: 0;
    aspect-ratio: 1;
    justify-content: center;
}
.xenfocus-social a[href*="/x.com"]::before{
    content: none;
}

And use this for your HTML:
HTML:
<li>
    <a href="https://x.com" target="_blank" aria-label="View our X page">
        <svg width="1200" height="1227" viewBox="0 0 1200 1227" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 1em; height: 1em;">
            <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z" fill="white"></path>
        </svg>
    </a>
</li>
 
Back
Top