The code in this download folder adds a button and image attributes to your block gallery images in WordPress. The code :
- Adds a button for like, favorite, wishlist, love with or without total count on the left.
- Adds the image title else caption else description else the filename without the file extension inline with the button.
Demo Video
Shows the image title display inline with the button else the image caption else the image description.
Works in any WordPress theme. Tested using the Twenty Twenty default theme for WordPress.
Installation
There’s 4 steps :
- Copy and paste the PHP code to your child themes functions file.
- Upload the file named gallery.js & button-title.js to your child theme folder.
- Copy and paste the CSS to the end of your child themes style.css file and clear caching.
- Install the favorites for WordPress plugin by Kyle Phillips and configure the settings to apply to media. Go to Favorites Settings > Display and Post Types > Enabled Favorites for : Media
Was This Tutorial Helpful?