This tutorial shows you how to use PHP and jQuery code to add your own custom like button to slides using Smart Slider 3 in WordPress.
The good thing here is you completely control the like button, not a social media provider so you can customize the button to your own requirements and turn it into any type of button you want.
Works in any WordPress theme.
Features
- Button contains a count which is saved in the database and shown on page load as well as updated on button click.
- Button styled using 2 CSS rules making for easy modification of colors, changing of icon and text.
- Works on both the free and pro versions of Smart Slider.
- Adds a unique button on each slide with its own count.
- Works with the Smart Slider block and non block themes using the classic editor.
Code Installation
There’s 3 basic steps :
- Upload the file named smart.js to your child theme folder.
- Copy and paste the PHP code to the end of your child themes functions.php file.
- Copy and paste the CSS to the end of your child themes style.css file and clear caching.
Was This Tutorial Helpful?