Add diferent links for the slider in the header

Hi,

I would like to modify the header slider to be able to have a diferent button link for each image. Or it is ok if it is easier to add a link on each image and mantain just one button link.

Could it be possible?

I also have intalled a child them, but copying all the slider.php in to functions.php and modify it, looks really unclean… so is there any cleaner way to do it? Or duplicate the slider.php to a folder inside the child theme and call it from the functions.php, is that possible?

Thank you very much.

Hello there,

Try this jQuery code solution instead of editing PHP file.

https://docs.athemes.com/article/57-different-buttons-for-each-slide

Regards,
Kharis

Thanks a lot!

So do I need to create a main.child.js in js folder at sydney child theme and copy the code there?
As well as call the main.child.js from themefunctions.php.

Is that ok?

Thanks.

Sorry, But the code isn’t working for me.

The Buttons are not showing up, but if I add the following command on each button:
$( '.slide-item:nth-of-type(1) .slide-inner' ).show(); //Slide 1
it appears, but doesn’t link to the web I added. And from the 3rt slider until the 5th the button appears under the slider Title.

Do you know why it happen?

Thanks again.

EDIT: Sorry, it was my problem, it works fine. Just have to be sure to have the “Stop text on next slider” torned off.