Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/lw-it-solutions/wp-light-dark-mode-images/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Give the featured image and Image blocks a second version for the other color scheme. Visitors in dark or light mode see the matching image.
- Second featured image in the post sidebar (meta box in the classic editor)
- Second image for the Image block in its block settings
- Standard
<picture>output withprefers-color-scheme, no JavaScript needed - Light or dark as the base scheme
- Optional selectors for a theme's own light/dark switch
Settings > Media. Requires WordPress 6.5 and PHP 7.4. Details in readme.txt.
License
GPL-2.0-or-later, see LICENSE.