Link a classic feature box

Hello, I’m trying to add a link to the icon and title of the feature box.
I tried already the
jQuery ( function( $ ) {
$(’#linked-feature-box .x-feature-box-text a:last-child’).each( function() {
$( this ).parents().find(’.x-feature-box’).wrapInner( ‘’ );
$( this ).remove();
But it seems it’s not working and I don’t know what am I doing wrong.
Also, is it possible to link different feature boxes to different links??
Thanks in advance.

Hello Giulia,

Check this article for the complete guide.
To adjust to work on multiple feature box, we can use class:

jQuery ( function( $ ) {
  $('.linked-feature-box').each( function() {
    $(this).find('a:last-child').each( function() {
       $( this ).parent().parent().parent().find('.x-feature-box-graphic-inner i').wrap( '<a href="' + $( this ).attr('href') + '"></a>' );
    $( this ).remove();
  } );} );

} );

We change this part $('#linked-feature-box') to this $('.linked-feature-box'). Then add this linked-feature-box on element CLASS field and not ID field.

That code is intended if you are using an ICON. If you are using an IMAGE, change this part find('.x-feature-box-graphic-inner i') to this find('.x-feature-box-graphic-inner img')

Make sure that link text and href field have values.

Hope this helps.

Hello Lely, sorry for my late reply.
I’ve been trying the process you suggested me, multiple times, but it’s still not working.
In the class field I had the hover_shadow function, I deleted it, and replaced with linked-feature-box but still no link.
I really don’t know what I’m doing wrong.
Just to be clear, I just have to copy the code as you sent it to me in te General JS. then put linked-feature-box in the class field of my classic feature box, and the link in the href field. Right? Am I missing something?
Thanks again.

OK, sorted!
It was because in the description underneath the icon I put some codes for bold text < b> without closing it < /b>.
Thanks. Now it’s perfectly working.

Glad that we could be of a help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.