JS for link to Classic Feature Box not working anymore

Hi,
I have had a JS on my website for almost 2 years now to make a classic feature box clickable but all of a sudden, it is not working anymore, and it shows the “link” text instead of making the icon clickable. I followed these instructions but it still doesn’t work.

Website is www.azaltitudetraining.com, the 4 buttons underneath the first section.

Thank you for the help.

Hey @gregrev,

Regretfully, we do not have support for custom development issues. That is even if you got the code here in the forum because custom codes are not official parts of the theme. They only also serve as a guide. Issues and enhancements should be directed to a third party developer in case the user does not understand how it works.

What I’d recommend instead for this case is you use a Button element to replicate the Classic Featured Box element. Here’s a sample usage or setup.

Hope that helps and thank you for understanding.

This doesn’t make any sense. This is NOT a third party issue, there is no third party here, this is a function available directly from X theme. Also, the code is code that was provided by X Theme initially and now doesn’t work. All I want is to be able to use a function that is native to X Theme, used to work for almost 2 years and suddenly doesn’t. Again, this has nothing to do with third party.

What’s happened to X Theme?! This used to be the most versatile and supported theme available online and now it’s just bugs after bugs and now no support. This is NOT how you treat long time supporters.

Hello There,

I am another staff checking in. There seems to be a problem with your site. I cannot check it.

We apologize for the confusion. Please understand that any code given in the forum is tailored according to one’s site. It may or may not work for the other depending on the site settings. The featured box by default does not offer a link feature for the image, icon or the title. We have designed it to have the link at the end of the text description. We know that we have given a solution in this thread: https://theme.co/apex/forum/t/code-snippet-add-a-link-to-feature-boxes/273 for the featured box to behave differently.

The code given may only work if you have only one featured box. It will cease to function when you have more than two featured boxes using only one ID. Keep in mind that an element ID must be unique so what you need to do is to add a custom linked-featured-box class instead and modify the JS code into this:

jQuery ( function( $ ) {

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

} );

I wish to check your implement and the way you have applied the ID in each of your featured boxes. Please resolve the error 500 first so that we can view the site and check your featured boxes and your code.

Thank you for your understanding.

Hi there. I’m having trouble getting this working, either with an ID or a class assigned.

Hey @reform,

To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

By the way, please make sure that you are up to date. Our latest versions are:

  • X 6.1.6
  • Cornerstone 3.1.6

Thanks.

Hi @RueNel

My apologies for not adding that info. You can see an example here: http://eyedialabs.ca/sovereign/test/

Here are some screenshots in cornerstone of the class and link I assigned to the feature box element and the javascript I have added.


Hey There,

The code is correct. The problem is that you did not add a link and link title in each of the feature box. Please be advised that the links will not display if you do not add link title attribute. Please removed the JS code first and make sure to properly set up the feature boxes with the text contents and the link as well.

Hope this helps. Kindly let us know.

Similar issue —I’ve tried applying the class and js on my site, and it’s not having the desired effect. Instead it just causes the text link to disappear.

I’ve only applied the style to the first feature box to test — http://pa.freakdemo.com

All help appreciated.

Hi @jasoncoburn

The code snippet needs to be modified like this:

jQuery ( function( $ ) {

  $('.linked-feature-box .x-feature-box-text 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();
  } );

} );

This should work fine on your website.
Thanks.

That works, thanks a million!

You’re more than welcome, glad we could help.

Cheers!

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