New Shortcode for Classic Feature Box?

Hi,
I’ve been using Feature Boxes along with some JS to allow the Title, Content, and Icon to link. However, since the latest update the code no longer works. Did the shortcode for the now Classic elements change?

This is the code that I am using that worked before:

( function( $ ) {

$(’.x-feature-box a’).each( function() {

var the_link = $(this).empty().clone();

$(this).parent().parent().parent().wrap(the_link);

$(this).remove();

} );

} );

Thank you for your help.

Hi There,

The structure is still the same. Try updating to this one:

jQuery(document).ready(function($) {
   $('.x-feature-box a').each( function() {
      var the_link = $(this).empty().clone(); alert(the_link);
      $(this).parent().parent().parent().wrap(the_link);
      $(this).remove();
    } );
} );

Let us know how this goes.

Perfect! That code worked. I only had to make a small modification to remove an alert that was popping up.
Final code used:

jQuery(document).ready(function($) {
$(’.x-feature-box a’).each( function() {
var the_link = $(this).empty().clone();
$(this).parent().parent().parent().wrap(the_link);
$(this).remove();
} );
} );

Thank you for the help!

You’re welcome!
We’re glad we were able to help you out.