Night mode as default
-
I’d like to display Night Mode as default, with the option for users to go to the light mode. How do I achieve this ?
Regards
Graeme
-
Hi,
unfortunately plugin still doesn’t have this option.
Soon the plugin will be upgraded with more options and default night mode will be one of the new options.
Best regards
Hey Marko,
I’m not looking for a setting in the customizer to do this, adding the function you use in the click event will also do, just steer me in the right direction.
Thanks for writing this BTW, work like a charm π
Graeme
Hi Graeme,
you can make this changes in plugin and Night Mode will be set as default:
1.) open
plugins/wp-night-mode/admin/class-wp-night-mode-admin.phpfile, find this line of code:if ( 'true' == $wp_night_mode ) {and just replace true with false.2.) open
plugins/wp-night-mode/public/class-wp-night-mode-public.phpfile, find this line of code:if ( 'false' === $wp_night_mode ) {and just replace true with false.3.) open
plugins/wp-night-mode/public/js/wp-night-mode-public.jsfile, find alltruevalues and change them tofalseand find allfalsevalues and change them totruethis is it.
Just be careful when the new version of plugin is released and when you update the plugin these changes will be overwritten.
Regards
Marko
You are a superstar π
Thanks π
I’m glad I could help
Thank you for those tips!
-
This reply was modified 6 years, 10 months ago by
Jim.
I followed all the steps without success. I made modest changes to the CSS and am very satisfied with the results. Switching works great but it isnβt persistent. Even going to a new page loads in regular mode. Any suggestions at your convenience would be appreciated. I can give you link. Thanks, Jim
Hi Jim,
please send me a link, it would be very helpful.
If you followed all steps everything should work properly. Have you tried to clear the cache?
The site is SanDiego-autodetail.com. I can create credentials for you if I have a private way to send them. Thanks, Jim
I’ve just released a new version of the plugin and one of the new options is “Night Mode as Default”.
You can find this option in Dashboard->Appearance->Customize->Night mode section and first option is “Night Mode as Default”. Just turn on this option and everything should work.
Please let me know if this option will not work in some case.
The update works like a charm! You can mark this resolved! Jim
@markoarula for some reason default night mode doesn’t work on my site. I tried to delete cache and tested it with multiple other users in normal browsing modes as well as in private browsing modes.
@power506 I would like to check why default night mode doesn’t work. Can you create credentials for me and send them to [email protected]
Hi @markoarula, fortunately, it worked a few hours after. Probably was a cache problem. Thanks for reply and thanks for this great plugin!
Glad to hear that everything works properly and that you like the plugin π
If you need anything else don’t hesitate to ask me.
Best regards
-
This reply was modified 6 years, 10 months ago by
The topic ‘Night mode as default’ is closed to new replies.