Add a Link to each Feature List Items

Hi Support

Is there any way in order to add a Link to each Feature List Items, as described in Code Snippets for Feature Boxes?

Thank You

Hi There,

Thank you for writing in, Classic Feature List Items provides a LINK TEXT and HREF field, please clarify what you’re trying to do.


Cheers!

As sggested into quoted Code Snipped, I’d like that the link provided inside each “link text” Feature List works for ALL List Item (title, text and icon), not only “link text”.

The quoted code Snipped do the same for feature boxes

Thank you

Hi again,

As you see this requires custom development and the script you’re referring to works with Feature Boxes and not with Feature List element. Feature list works in a different way and the styling it keeps is unique and will be disturbed if you try to wrap with an anchor tag.

With that being said, I can point you in the right direction but as I said this requires custom development so the code I’m providing serves as a guide only and this will mess up the styling of the feature list element as I mentioned above due to the unique styling. We won’t be able to support any issue caused the following script, you’ll have to sort it on your own.

You can try two options either use this code in Theme Options > JS

jQuery ( function( $ ) {
  $('.x-feature-box').each( function() {
    var link = $( this ).find('a').attr('href');
	$(this).wrapInner( '<a href="' + link + '"></a>' )
  });
});

Or this one will keep the maximum styling but still the layout will be disturbed:

jQuery ( function( $ ) {
  $('.x-feature-box').each( function() {
    var link = $( this ).find('a').attr('href');
	$(this).wrap( '<a href="' + link + '"></a>' )
  });
});

Hope this helps!

I understand your suggestion

I thank you for your precious support

You’re most welcome!

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