Make Users Social Media links in Xenforo CLICKABLE

Sameer Memon
Sameer Memon
4 Min Read
- Advertisement -

Hello mate, if you have been using Xenforo for some time, you pretty well know that there is an option to add your social media links in your profile setting. By default, you only have SKYPE, FACEBOOK, and TWITTER options. At the same time, you can simply add more options by adding the user custom field (shown later in this post).

By default the links are shown on your profile as simple text like the below:

xenforo user custom field

But these are pretty useless, coz you cannot click on them. You must copy the username and search for them on social media.

Today we are going to solve this problem. We are going to convert these social media links to clickable links. Like this:

social media profile links in xenforo user fields

Any user will be available to visit the required links just by clicking on the usernames.

Let’s start!

- Advertisement -

Skype

We will use HTML hyperlink tags to create a link to users’ social media.

Goto ACP->Users->Custom user fields-> Skype. Scroll down to General options and inside “Value display HTML” add the following code:

<a href="skype:{$value}" target="_blank">{$value}</a>

The code is pretty much straightforward. We have created an HTML hyperlink tag that will point to the skype username where the {$value} will be the username inserted by the user under their account details.

add skype links in xenforo

Click Save.

You can check it by adding your skype username to your account details.

- Advertisement -

Facebook

Let’s do this for Facebook. This one is tricky due to Facebook URL behavior.

You cannot create a hyperlink to add a user’s FB username since FB URLs are different based on user settings. It sometimes shows profile id as numbers whereas sometimes it shows as usernames.

URL with numbers example: https://www.facebook.com/profile.php?id=1000000000431

while another version: https://www.facebook.com/geekynotreal.75

So it’s not feasible to create hyperlinks for such. So we will create a universal link where users need to enter their whole profile link. And we will display the link OR a “Message me of FB” title.

Goto ACP->Users->Custom user fields-> Facebook.

- Advertisement -

Under “Options for text fields” select “URL“.

option for text field

Scroll down to General options and inside “Value display HTML” add any 1 of the following code:

<a rel="nofollow" href="{$value}" target="_blank">{$value}</a>

Result:

FB links in

OR

<a rel="nofollow" href="{$value}" target="_blank">Message me on FB</a>

Result:

fb links
adding facebook user links in xenforo

Click Save when done.

Twitter

Now let’s do this for Twitter:

Goto ACP->Users->Custom user fields-> Twitter. Scroll down to General options and inside “Value display HTML” add the following code:

<a rel="nofollow" href="https://twitter.com/{$value}" target="_blank">{$value}</a>
add twitter links in xenforo user fields

Click save when done.

Instagram

Now its time for Instagram

Start with adding a new custom field. Goto ACP->Users->Custom user fields. Click +Add field.

I kept the Display Order as 1 so that the Instagram link should be shown on top of the user profile.

add custom user field
add instagram in user custom field

Result:

instagram option in xenforo user custome field
the result you will see after this complete post

I guess you have understood the logic behind this now.

Likewise, you can create multiple user fields and use the codes to display the social media links.

You can further customize the looks of the links using CSS.

That’s all for this post now.

Thanks for reading it. If you have any doubts, you can comment below.

- 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.