Add icons to User Banners in Xenforo

Sameer Memon
Sameer Memon
3 Min Read
- Advertisement -

Earlier we learned how to add custom banners for specific usergroups, now we are going to learn how to add icons to user banners. The procedure remains the same for all default or custom banners.

Let me 1st show you the output of this post

icons for user banners

Looks cool right?

Lets start with finding the banner class div.

I am assuming that you have already created custom banners and assigned users to it.

Firstly find the banner class for which you want to add icon. We have 2 ways for it, one it by checking the app_user_banners.less template or else we can simply right-click on the banner and find it from developers mode.

- Advertisement -

For 1st method:

Go to Admin Panel>Apperance>Template> search for app_user_banners.less. Click to edit

app user banners.less phrases in
custom user banner entry in

Copy the code of the banner you want to add an icon for. For e.g “.userBanner–admin” you don’t need the rest of the code.

2nd Method is by right-clicking the banner and clicking inspect.

how to find class using inpect in chrome

Now go to Admin Panel>Apperance>Template> search for extra.less. Click to edit.

The template will be empty if you haven’t done any customizations

- Advertisement -
extra.less template in xenforo

Scroll to the end. You can add gaps between new codes.

extra less template

Wondering what the above codes do? Check out Animated Usernames in Xenforo.

Now copy the below code and paste it after “}” at any line.

/* Banner icon for we are family */
.userBanner.userBanner--demo1
{
	&:before {
		 .m-faBase();
		 .m-faContent(@fa-var-hand-spock);
		 padding-right:4px
	}
}

“/* Banner icon for we are family */” is optional and is done to remember the code function for future use.

change “.userBanner–demo1” with your banner code.

Change “hand-spock” with your desired icon code. Select your icons from FontAwesome. Be sure to add @far-var- before the code, or else the icon won’t work.

- Advertisement -
how to add icons to user banners in xenforo

I am adding icons for 3 banners namely Admin, Staff, and demo1.

Click Save.

I guess you have already added users to the new groups. If haven’t yet, follow the post to add.

For this Go to Users>List all Users Select the user you want to add to the new group. Under Secondary User Group check all the groups you want to add the user.

how to add xenforo user to groups

Click Save when done.

Now go back to the forum to check the updated users.

- Advertisement -
Follow:
Sameer Memon is a passionate writer with 3 years of experience in Blogging. With a strong background in Blogs, SEO, and Social Media Marketing, Sameer has been creating engaging content on various topics for a wide range of clients. As a dedicated and driven individual, Sameer takes pride in delivering well-researched and thoughtfully written articles that provide readers with valuable insights and information. He is constantly striving to stay up-to-date with the latest industry trends and techniques to produce content that is not only informative but also engaging and easy to read. When Sameer isn't busy writing, he enjoys gaming. He also loves to explore new places to gain fresh perspectives and inspiration for his writing. If you're interested in learning more about Sameer and his work, you can follow him on social media platform at give handles.