Support » Theme: Customizr » Adding Links to Slider Images

  • Resolved omerbaturay

    (@omerbaturay)


    Hey guys,

    Im trying to link each slider image to different parts of my website on my homepage but am failing to do so. I’ve looked at the snippet available for this purpose but it only works for one slider image. The “array” code given is also failing to link any of the slider images anywhere.

    The website is omerbaturay.com and the array snippet is currently active with no links being present on any slider images. The code is in functions.php and it is as follows:

    add_filter('tc_slide_link_url' , 'my_slide_custom_link', 208, 214, 213, 209);
    function my_slide_custom_link( $slide_link , $image_id ) {
        //custom links array : image_id => link
        $image_links = array(
            '208' => 'https://vimeo.com/81040719',
            '214' => 'http://www.eddhawkes.co.uk/wp-content/uploads/2014/01/Union-Jack-Final.jpg',
            '213' => 'https://vimeo.com/81078747',
            '209' => 'https://vimeo.com/'
        );
    
        //does nothing if the requested image_id is not a key of the array
        if ( ! array_key_exists( $image_id, $image_links ) )
            return $slide_link;
    
        //else returns the custom link
        return $image_links[$image_id];
    }

    Any ideas? Thank you very much.

Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Adding Links to Slider Images’ is closed to new replies.