Jetpack by WordPress.com
[resolved] Adding class to specific images in Carousel gallery (2 posts)

  1. Bitwize
    Posted 3 years ago #

    First off, I'd like to say that I'm not entirely sure if this is the best place to ask, or if it'd be better to be asked in the general support forum. The reason I chose here is because I'm using Jetpack/Carousel as the gallery, and I think it does edit/override some of the properties of the vanilla gallery.

    Basically what I'd like to add is the option of an individual class to each image (for display purposes).
    For example, in a 10-image gallery, perhaps the 3rd one has the class "award" which would make it look differently for having won an award.

    I know how to add new fields with a filter of 'attachment_fields_to_edit', I just want to find out how to apply it to the images thumbnails.

    Thanks to all who offer advice!


  2. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 3 years ago #

    Jetpack doesn't modify the core Gallery shortcode, but uses Javascript to add extra features to the galleries.

    You can do the same and use jQuery to add a specific class to the thumbnails. You can read more about it here:

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic