Enhance Your WordPress Site with Custom Social Feeds via Ultimate Member Plugin

As a web developer, I have often found myself in situations where my clients are looking for customizable and editable features on their websites. One such feature that is commonly requested is the ability for users to display their social media profiles in a visually appealing format. Recently, I had a group of people who were registered on my website and wanted to showcase their Twitch accounts along with other social media profiles like Pinterest and TikTok. While updating the website’s theme did not add any new social icons, I found a simple solution by using custom PHP code as suggested in the Ultimate Member documentation.

In this blog post, I will share my experience of adding custom social fields to a WordPress website using Ultimate Member and how you can do it too.

The Problem and the Solution

The problem was that even after updating the theme, the users were not able to see their desired social media profiles on their user profiles. The solution was to use custom PHP code to add more social fields as suggested in the Ultimate Member documentation.

How to Add Custom Social Fields

To add custom social fields, you can use the following code snippet and add it to the file functions.php in the active theme directory. You can also create a child theme and update that one instead of editing the parent theme. This script will add Pinterest, TikTok, and Twitch, but you can modify it to add whatever social media platforms you want.

The code snippet is as follows:

“`php

function ultimate_member_custom_social_fields() {

$fields = array(

‘pinterest’ => ‘Pinterest’,

‘tiktok’ => ‘TikTok’,

‘twitch’ => ‘Twitch’,

);

return apply_filters(‘um_custom_social_fields’, $fields);

}

add_filter(‘um_social_fields’, ‘ultimate_member_custom_social_fields’);

“`php

In this code, we have defined an array of fields that will be displayed on the user profile page. These fields are Pinterest, TikTok, and Twitch. We have also added a filter to apply the custom social fields to the user profiles using the `um_custom_social_fields` hook.

Benefits of Using Custom PHP Code

Using custom PHP code to add custom social fields has several benefits. Firstly, it allows you to have complete control over the design and functionality of your website. You can modify the code to fit your specific needs and requirements. Secondly, it ensures that your website’s functionality is not limited by the theme or plugin that you are using. Finally, using custom PHP code makes your website more flexible and scalable as you can easily add new features without having to update the entire theme or plugin.

Conclusion

In this blog post, we have discussed how to add custom social fields to a WordPress website using Ultimate Member. We have also explored the benefits of using custom PHP code to achieve this feature. By following the steps outlined in this post, you can easily add custom social media profiles to your website and make it more visually appealing for your users. So go ahead and give it a try!

Leave a Reply