Notifications
Clear all

[Closed] Add social network

10 Posts
6 Users
0 Reactions
8,483 Views
Sofy
Posts: 4871
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi annabwashere

The code provided in this post just changes appropriate icons of these fields. The phrases you can change from Dashboard > Forums > Phrases admin page. 

Please check out the wpForo – User Custom Fields paid addon, that allows to manage default profile fields and add new custom profile fields.

Posts: 52
(@thedrawingboard)
Trusted Member
Joined: 6 years ago

Hi there - 

I posted a similar question in the thread at  https://wpforo.com/community/how-to-and-troubleshooting-2/how-to-display-member-social-icons-under-member-name-in-forums/

I found this thread and am wondering if the steps shown here will add the additional social media icons I'm looking for in the area beneath a member avatar in posts. 

I understand the directions here. I created a child of our Wordpress theme, and put the code above in the function.php file. I also have the MemberFields Addon, so went into that AddOn to change the fields (AIM to Instagram and MSN to Pinterest), but unfortunately, this didn't work. The icons in the member profile page didn't change either (even though I changed the Font Awesome icon in the code posted above). 

Currently, only Facebook and Twitter show as icons under a member avatar within a post. I thought maybe the steps above would allow me to add the other two icons in this space - but I guess not. 

Does anyone have other ideas on how this can be accomplished? 

I am not a developer - just know enough to get around inside the editor files and can follow direction. 😉 

Thanks for any tips on this!

Posts: 18
(@uckun)
Eminent Member
Joined: 6 years ago

Hi Robert, I tried to do what you described and it worked for one icon (I changed Skype to Instagram succesfully).

HOWEVER: I'm trying to do the same thing for the Google+ icon to convert it to Youtube icon, but it when I write the code twice in the functions.php , it doesn't work for the second icon change. I still see the Google+ icon there. What I did is: I wrote the code you provided two times in the functions.php, by changing the approriate places as you described, but it doesn't change the second icon. Can't I use this code twice in the functions.php for changing more than one icons?

Here is what I wrote: (What am I doing wrong?) 

-------------------------------------------------------------

function wpforo_change_social_field_icon( $fields ){

 //Field name

 $field = 'skype';

 //Font-Awesome icon class  http://fontawesome.io/icons/

 $icon = 'fab fa-instagram';

 if( !empty($fields) && isset($fields[$field])) $fields[$field]['faIcon'] = $icon;

 return $fields;

}

add_filter( 'wpforo_member_after_init_fields', 'wpforo_change_social_field_icon' );

 

function wpforo_change_social_field_icon( $fields ){

//Field name

 $field = 'gtalk';

 //Font-Awesome icon class  http://fontawesome.io/icons/

 $icon = 'fab fa-youtube-square';

 if( !empty($fields) && isset($fields[$field])) $fields[$field]['faIcon'] = $icon;

 return $fields;

}

add_filter( 'wpforo_member_after_init_fields', 'wpforo_change_social_field_icon' );

 --------------------------------------------------------

 

When I write like this, functions.php gives error when saving, saying:

"Cannot redeclare wpforo_change_social_field_icon() (previously declared in wp-content/themes/Avada/functions.php:12)"

How can I change both of the icons? 

Page 2 / 2