Link and icon for linkedin


#1

Hello,
I see that Moesha Pro has an option for a linked in link. Can this be added to Sydney Pro?

-Ben


#2

Hello Ben,

If you mean adding a LinkedIn link to your “Social” menu for displaying in Social widget, then yes, it can be added to Sydney Pro.

Just go to your Dashboard -> Appearance -> Menus -> choose “Social” from drop-down list -> add your LinkedIn link via “Custom Links” (on the left side).

Let me know if you need mere help :slight_smile:

Best Regards, Roman.


#3

Hi Roman,

I had a look and couldn’t find what you were trying to direct me to.

I think we have out wire crossed. In Sydney there is a section for Employees. In the Employee Info section, there’s Position, Twitter, Facebook, Google +. Is there an easy way to add Linked for each employee or is there an upgrade coming up?

-Ben


#4

Yes Ben, there is a way to add LinkedIn, but I wouldn’t call that way “easy” :slight_smile:

  1. Create a child theme (if you did not do it before).

  2. Go to your Dashboard -> Types -> Custom Fields -> Employee info -> scroll down to Fields section and add LinkedIn from User created fields section (on the right side) -> click Save.

  3. Add LinkedIn links to your employees.

  4. The most interesting part, copy fp-employees.php from your parent theme’s widgets folder to your child theme’s widgets folder and open it up. Add this code:

$linkedin = get_post_meta( get_the_ID(), 'wpcf-linkedin', true );

right after this:

$google = get_post_meta( get_the_ID(), 'wpcf-google-plus', true );

And add this code:

<?php if ($linkedin != '') : ?>
<li><a class="linkedin" href="<?php echo esc_url($linkedin); ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
<?php endif; ?>

after this:

<?php if ($google != '') : ?>
<li><a class="google" href="<?php echo esc_url($google); ?>" target="_blank"><i class="fa fa-google-plus"></i></a></li>
<?php endif; ?>

Then unregister_widget of parent theme and register_widget of child theme with a different classname in child theme’s functions.php. Finally, “require” new widget from child theme’s functions.php.

You might want to hire someone to help you accomplish it if you feel that it’s too complicated for you.

Best Regards, Roman.


#5

You had me until this bit:

Then unregister_widget of parent theme and register_widget of child theme with a different classname in child theme’s functions.php. Finally, “require” new widget from child theme’s functions.php.

That’s not something I’ve done before… However it all works well after making the change to the parent theme (now that I know the concept worked, I can learn about child themes and apply the change that way).

Thanks for your help and feel free to mark this thread as closed :slight_smile:


#6

Hi Ben,

Yes, this part is the most complicated because it requires some PHP coding.

Here is a nice tutorial about WordPress widgets:

And here you can find documentation on register_widget and unregister_widget functions:
https://codex.wordpress.org/Function_Reference/register_widget
https://codex.wordpress.org/Function_Reference/unregister_widget

And something about “requiring”:

That’s a lot of homework, but I hope that it will help you understand it :slight_smile:

Kind Regards, Roman.


#7

Hi Roman

I followed your guidance and added the LinkedIn link to the employees section. It all works great apart from the colour of the icon is wrong. Can you advise how to make it the correct colour?

Link to my site here: www.mtmaruma.com
Colour I want the icon to be here: #007bb6

Many thanks
Misha


#8

Hello Misha,

Please use this CSS code to change the color of LinkedIn icon:

.share-social .linkedin {
    background: #007bb6 !important;
}

You can add CSS code to style.css file of your child theme, also you can use Simple Custom CSS or similar plugin for adding CSS code.

Kind Regards, Roman.

P. S.
It is better to create your own topic for your question to keep forum in order.


#9

Thanks Roman.


#10

You are welcome Ben,

And have a nice day :slight_smile:

Kind Regards, Roman.


#11