This is a simple wordpress plugin for registration and logging via modal windows. You can use it, test it, expand it etc. What ever works for you.
You can download this repo and then just install plugin to your theme.
After that, it's pretty easy to use it:
- Upload
wp-night-mode
to the/wp-content/plugins/
directory - Activate the plugin through the 'Plugins' menu in WordPress
- Use
wp-night-mode
class on any element (for example Menu item) or[wp-night-mode-button]
shortcode to show Night Mode toggle button - Shortcode options:
- "style" option, for Toggle Style. Use it like this:
[wp-night-mode-button style="4"]
- "style" option, for Toggle Style. Use it like this:
- Go to Customizer and set styles for Night Mode
- Initial release
- Tested on WordPress 4.9.8
- Fixed issue: toggle button does not work on mobiles and tablet
- Added cookies so that browsers can know whether the user has switched to night mode or not
- Added Toggle Style selector in Customizer and 5 different styles of toggle switcher are availabled now
- Fixed small CSS error
- Tested on WordPress 5.1.1
- Tested with Gutenberg
- Fixed cache issue and tested with plugins: Comet Cache, WP Rocket and Autoptimize
- Tested on WordPress 5.2.2
- Added "Night Mode as Default" option (on first website visit user will see Night Mode and can switch to Light Mode)
- Added
prefers-color-scheme
media query (media query to detect if the user has set their system to use a light or dark color theme) - Added "Toggle Size" option (easily change the size of the toggle button)