Title: Adding CSS Selectors?
Last modified: May 26, 2026

---

# Adding CSS Selectors?

 *  [Pieter Sand](https://wordpress.org/support/users/beachholiday/)
 * (@beachholiday)
 * [3 weeks, 2 days ago](https://wordpress.org/support/topic/adding-css-selectors-2/)
 * Dear Arno,
 * We are wondering whether there is a way to add custom CSS selectors?
 * Ideally, the plugin would have a text field under ‘General’ where we could manually
   add CSS classes for the Lightbox to target.
 * Alternatively, is there a code snippet that we could add to our child theme’s
   php file?
 * Many thanks for your help with this. We would love to use your Lightbox on our
   site 🙂
 * Piet

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [3 weeks, 2 days ago](https://wordpress.org/support/topic/adding-css-selectors-2/#post-18919516)
 * Maybe there is a misunderstanding how the plugin works.
 * All images links **must** be handled in the backend on the server. A simple client
   side only CSS selector does not work. The frontend scripts do not just look for
   image links, it will use what the backend has prepared first.
 * Also see:
 * Backend part which parses the HTML code and reads image metadata, EXIF information
   and so on: [https://codeberg.org/askaaron/lightbox-photoswipe/src/branch/main/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php](https://codeberg.org/askaaron/lightbox-photoswipe/src/branch/main/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php)
 * Frontend integration for PhotoSwipe 5 (uncompressed version before the deployment):
   [https://codeberg.org/askaaron/lightbox-photoswipe/src/branch/main/assets/ps5/frontend.js](https://codeberg.org/askaaron/lightbox-photoswipe/src/branch/main/assets/ps5/frontend.js)
 *  Thread Starter [Pieter Sand](https://wordpress.org/support/users/beachholiday/)
 * (@beachholiday)
 * [1 week, 1 day ago](https://wordpress.org/support/topic/adding-css-selectors-2/#post-18934297)
 * Dear [@awelzel](https://wordpress.org/support/users/awelzel/)
 * Many thanks for the clarification.
 * You are quite right, we misunderstood how the plugin works.
 * Kind regards,
 * Piet

Viewing 2 replies - 1 through 2 (of 2 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadding-css-selectors-2%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/lightbox-photoswipe/assets/icon-256x256.png?rev=2906302)
 * [Lightbox with PhotoSwipe](https://wordpress.org/plugins/lightbox-photoswipe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-photoswipe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-photoswipe/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-photoswipe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-photoswipe/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Pieter Sand](https://wordpress.org/support/users/beachholiday/)
 * Last activity: [1 week, 1 day ago](https://wordpress.org/support/topic/adding-css-selectors-2/#post-18934297)
 * Status: not resolved