Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Social media icons in user/instructor profile
- This topic has 12 replies, 3 voices, and was last updated 6 years, 1 month ago by realhituni.
Viewing 13 posts - 1 through 13 (of 13 total)
-
AuthorPosts
-
February 20, 2018 at 4:47 pm #147241realhituniParticipantHi, I am trying to get the social media icons to appear on user/instructor profiles. I followed the instructions you posted here: https://wplms.io/support/knowledge-base/social-profile-field-group/, but I still get a list of social media links rather than the icons. See: https://prnt.sc/ihf31w Also, can I get the links to open in a new tab by default? Thanks.February 21, 2018 at 10:32 am #147327H.K. LatiyanParticipantHi, You are seeing the profile page on the profile page you'll see the link, but as shown in the article also if you add the member on the page like using the page builder, there you can see the icons.February 23, 2018 at 10:05 am #147632realhituniParticipantHi, Thanks for getting back me. I am not sure what you suggest I do. I want the social media icons to appear on user profiles, e.g. when you go to site.com/members/xyz, not when you embed the profile on other pages. Plus, how do I get them to open on a new tab by default? ThanksFebruary 24, 2018 at 5:28 pm #147786H.K. LatiyanParticipantHi, If you can please share your site url and the admin credentials then I can show it on your website how to show the icons. PS: Please mark your reply as private while sharing the credentials.March 1, 2018 at 3:05 pm #148429realhituniParticipantThis reply has been marked as private.March 3, 2018 at 8:42 am #148625H.K. LatiyanParticipantThis reply has been marked as private.March 5, 2018 at 12:49 pm #148873realhituniParticipantThis reply has been marked as private.March 6, 2018 at 9:58 am #148997H.K. LatiyanParticipantHi, For this, try adding the below code in your wplms-customizer.php file present in your wplms customizer plugin: add_action('bp_after_member_header',function(){ $social_field_group = vibe_get_option('social_field_group'); $bp_xprofile_groups = $groups = bp_xprofile_get_groups( array( 'fetch_fields' => true ) ); $member_html .= '<ul class="socialicons">'; if(!empty($bp_xprofile_groups)){ foreach($bp_xprofile_groups as $g){ if($g->name == $social_field_group){ if ( !empty( $g->fields ) ) { foreach ( $g->fields as $field ) { $id = $field->id; $url = strip_tags(bp_get_profile_field_data( array('user_id'=> $user->ID,'field' => $field->name) )); if(!empty($url) && strlen($url)>2){ $n = strtolower($field->name); if(strpos($url,'http://') === false){$url = 'http://'.$url;} $member_html .= '<li><a href="'.$url.'" class="'.$n.'"><i class="fa fa-'.$n.'"></i></a></li>'; } } } } } } $member_html .= '</ul>'; echo $member_html; });March 8, 2018 at 1:25 pm #149366realhituniParticipantHi, thanks for this, but it didn't work I am afraid.March 9, 2018 at 5:37 am #149443H.K. LatiyanParticipantHi, Sorry, I forgot to echo the variable at the last. I have updated the code in my previous reply and also added the code to your website. Now, it shows the icons on your website, refer: http://prntscr.com/ios2drMarch 12, 2018 at 4:59 pm #149798realhituniParticipantAmazing! Many thanks for your help. The only thing I added is a target="_blank" so that links open in a new tab.March 13, 2018 at 6:29 am #149851DianaParticipant@realhituni, Can we close this topic now?March 13, 2018 at 4:29 pm #150011realhituniParticipantYes, please do.
-
AuthorPosts
Viewing 13 posts - 1 through 13 (of 13 total)
- The topic ‘Social media icons in user/instructor profile’ is closed to new replies.