Title: Slider Hyperlink
Last modified: August 17, 2023

---

# Slider Hyperlink

 *  [ineson85](https://wordpress.org/support/users/ineson85/)
 * (@ineson85)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/slider-hyperlink/)
 * Hi everyone.
 * I have recently started to take the time to develop our companies website and
   the theme that is being used is a custom theme by a company that has since gone
   bust.
 * There are manythings that i am currently on with correcting on the website but
   the main horizontal slider on the homepage doesn`t click through the the designated
   location unless a specific area on the slider is clicked.
 * Is this an easy fix so that the whole slider becomes a hyperlink?
 * Thanks in advance. Cheers
    -  This topic was modified 2 years, 9 months ago by [ineson85](https://wordpress.org/support/users/ineson85/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fslider-hyperlink%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [corrinarusso](https://wordpress.org/support/users/corrinarusso/)
 * (@corrinarusso)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/slider-hyperlink/#post-16980121)
 * Holy cow …….
 * But to answer your question, it looks like you are using WP Slick Slider and 
   Image Carousel, best to ask them:
 * [https://wordpress.org/support/plugin/wp-slick-slider-and-image-carousel/](https://wordpress.org/support/plugin/wp-slick-slider-and-image-carousel/)
 *  [Albert Bretado](https://wordpress.org/support/users/abretado1985/)
 * (@abretado1985)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/slider-hyperlink/#post-16982139)
 * See if adding this code to your functions.php file helps:
 *     ```wp-block-code
       function add_slider_clickable_link() {
           echo "
           <script>
           jQuery(document).ready(function($) {
               $('.carousel-item').each(function() {
                   var link = $(this).find('a').attr('href');
                   $(this).css('cursor', 'pointer');
                   $(this).on('click', function() {
                       window.location.href = link;
                   });
               });
           });
           </script>
           ";
       }
       add_action('wp_footer', 'add_slider_clickable_link');
       ```
   
 * Here’s a step-by-step explanation of what the code does:
    1. Wait for the document to be ready before executing the code.
    2. Select all elements with the class `carousel-item`.
    3. For each slide, do the following: a. Find the anchor element (`<a>`) within 
       the slide and get the value of its `href` attribute (which is the link). b. 
       Change the cursor style to a pointer when hovering over the slide to indicate
       that it is clickable. c. Add an event listener for the click event. When the
       slide is clicked, it redirects the user to the link.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Slider Hyperlink’ is closed to new replies.

## Tags

 * [hyperlinks](https://wordpress.org/support/topic-tag/hyperlinks/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 2 replies
 * 3 participants
 * Last reply from: [Albert Bretado](https://wordpress.org/support/users/abretado1985/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/slider-hyperlink/#post-16982139)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
