Hello Ralf,
To add a LinkIn icon link on each employee, please follow these steps:
- Install and activate the TC Custom JavaScript plugin
- Go To Appearance > Custom JavaScript
- Paste the following code into the provided box
;(function($) {
'use strict'
if( $('.roll-team').length ) {
var linkedInIcon = function(url) {
return '<li><a class="linkedin" target="_blank" href="'+url+'"><i class="fa fa-linkedin"></i></a></li>';
}
$('.roll-team .team-item').each(function(i){
var n = i+1;
var linkedInURL = '';
if( n == 1 ){ // LinkedIn profile for employee 1
linkedInURL = 'http://linkedin.com/profile-1';
}
if( n == 2 ){ // LinkedIn profile for employee 2
linkedInURL = 'http://linkedin.com/profile-2';
}
if( n == 3 ){ // LinkedIn profile for employee 3
linkedInURL = 'http://linkedin.com/profile-3';
}
if( n == 4 ){ // LinkedIn profile for employee 4
linkedInURL = 'http://linkedin.com/profile-4';
}
if( n == 5 ){ // LinkedIn profile for employee 5
linkedInURL = 'http://linkedin.com/profile-5';
}
if( n == 6 ){ // LinkedIn profile for employee 6
linkedInURL = 'http://linkedin.com/profile-6';
}
if( n == 7 ){ // LinkedIn profile for employee 7
linkedInURL = 'http://linkedin.com/profile-7';
}
$(this).find('.team-social').prepend(linkedInIcon(linkedInURL));
});
}
})(jQuery);
The code above looks complicated, but it isn’t. See the line starting from this code block:
if( n == 1 ){ // LinkedIn profile for employee 1
linkedInURL = 'http://linkedin.com/profile-1';
}
to this:
if( n == 7 ){ // LinkedIn profile for employee 7
linkedInURL = 'http://linkedin.com/profile-7';
}
It means to add 7 LinkedIn icons. The first employee LinkedIn address is defined within this this code:
if( n == 1 ){ // LinkedIn profile for employee 1
linkedInURL = 'http://linkedin.com/profile-1';
}
Do an adjustment to match with the exact address.
- Update
I hope it’ll be easy to follow.
Please let us know if further questions come up.
Regards,
Kharis