Classic element link images

Hi there,

I added some classic elements on my homepage (www.apresski-store.com) but I can not find a way to make the images clickable. Could you please help me solving this issue? Many thanks in advance.

Best regards,

Antwin Grevengoed
Apr├Ęs Ski Store

Hello Antwin,

Thanks for writing in!

Please take a look at the solution shared in following tutorial to link images in classic feature box:

Thanks.

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

Hi @antwingrevengoed,

This code works,

jQuery ( function( $ ) {

  $('.home .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();
  } );

} );

But I recommend fixing your existing codes first, any code added below it will not work. Example,

jQuery("input[name='apply_coupon']").attr("value","Kortingscode toevoegen");
jQuery(".related.products h2").html("Gerelateerde producten");

jQuery(document).ready(function($){
	$('.h-landmark span').html("Shop");
	
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();
  } );

} );

This part is wrong without proper closing,

jQuery(document).ready(function($){
	$('.h-landmark span').html("Shop");

It should be

jQuery(document).ready(function($){
	$('.h-landmark span').html("Shop");
} );

Hence, the final code should be like this

jQuery("input[name='apply_coupon']").attr("value","Kortingscode toevoegen");
jQuery(".related.products h2").html("Gerelateerde producten");

jQuery(document).ready(function($){
	$('.h-landmark span').html("Shop");
	});


jQuery ( function( $ ) {

  $('.home .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();
  } );

} );

Hope this helps.

1 Like