Employee widget photo link

Hello, I would like for the images in my employee widget to also link to the employee link. How can i do this?

Hello there,

We could suggest you with custom code solution for your question. But we need to know how you set up you employee by checking it directly. Please share a link to your website here.

Regards,
Kharis
aThemes Support

Here’s the link to my website: https://bit.ly/34LDQsG
It is the section titled “Productos Nuevos”.

Hello there,

Thank you for getting back and sharing the link.

Please try doing the below steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    jQuery(function($) {

     if( $('.widget_athemes_employees').length ) {
         $('.team-item').each(function(){
           var link = $(this).find('.team-item-name a').attr('href');

           if(link != undefined) {
             $(this).find('.team-item-img').wrapInner('<a href="'+link+'"></a>');
           }

         });
     }

    });
  1. Update

Let me know how it goes.

Regards,
Kharis
aThemes Support

Hi, thank you. It worked :+1:

1 Like

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis
aThemes Support

Hello, I have noticed that this only works in desktop. Is there any way to make it work also on tablets and smartphones? Thank you.

Hello there,

The code above should also be working on mobile screens, because it affects on single markup that presents on smaller screen as well.

There might be mobile web browser’s cache that’s blocking the code to load since it loads the cached version of your website. I request you to clear/flush history, cache, and restart it. Then run your test.

Regards,
Kharis
aThemes Support

Hello, I tried with a different phone and it worked. Thanks!

1 Like

Great! Glad to hear that you got it resolved.

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis
aThemes Support