Add Button & Image Attributes to WP Gallery Block

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 :

  1. Copy and paste the PHP code to your child themes functions file.
  2. Upload the file named gallery.js & button-title.js to your child theme folder.
  3. Copy and paste the CSS to the end of your child themes style.css file and clear caching.
  4. 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

Download Folder

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.