Featured Boxes - Link to a Specific Category

Hello and Happy Holidays!

In using Featured Boxes how can I get each box to link to a specific category in my shop and not just the shop page?

For example for my website www.thevenetianmasks.com I am using 8 featured boxes. At the moment they are linked to the store. How can I get each box to link to each category? For example, the “Animals” featured box shows just the Animals mask and not the entire shop as it is currently set up.

Thank you in advance for your time and consideration.

Hi,

Thank you for contacting us about our theme, Leto. I am happy to help with your queries.

Please try doing these steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    ;(function($) {

       'use strict'

       if( $('.list-categories-section').length ){

         $('.list-categories-section .category-item').each(function(){

           var link = $(this).find('.category-item__link > a').attr('href');

    			 $(this).find('.category-item__inner').wrapInner('<a href="'+link+'"></a>');

         });

       }

    })(jQuery);
  1. Update

Regards,
Kharis
aThemes Support

Thank you for your response.

I am adding this code to the Additional CSS?

Hi,

I am sorry for the incomplete steps.

Try these:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    ;(function($) {

       'use strict'

       if( $('.list-categories-section').length ){

         $('.list-categories-section .category-item').each(function(){

           var link = $(this).find('.category-item__link > a').attr('href');

    			 $(this).find('.category-item__inner').wrapInner('<a href="'+link+'"></a>');

         });

       }

    })(jQuery);
  1. Update

Regards,
Kharis
aThemes Support

Thank you for the message.

When I do as instructed and copy the code provided I am given a 403 Forbidden message that says “A potentially unsafe operation has been detected in your request to this site”

Hi,

Try adding this code to your child theme’s functions or use Code Snippets plugin.

    add_action('wp_footer', function(){ ?>

      ;(function($) {

         'use strict'

         if( $('.list-categories-section').length ){

           $('.list-categories-section .category-item').each(function(){

             var link = $(this).find('.category-item__link > a').attr('href');

             $(this).find('.category-item__inner').wrapInner('<a href="'+link+'"></a>');

           });

         }

      })(jQuery);  

    <?php 
    }, 9999);

Regards,
Kharis
aThemes Support

Thank you.

Do you mean adding the Code Snippets plugin and code ONLY or add the Code Snippets plugin code AND the TC Custom JavaScript plugin and code.

Thank you for the clarification.

I meant:

Enaling the Code Snippets plugin and add the JavaScript code above with it.

Let me know in case you need further help.

Regards,
Kharis
aThemes Support

Thank you but not clear.

You wrote add the JavsScript with the Code above it?

Is this the first set of code or the second set of code?

Hello, following up on this thread, please.

Thank you