How to define custom button as toggle switch?

Thank You.

In the “SWITCH STYLE” tab, at the bottom, you will find the “Alternative Dark Mode Switch” setting. There you can add your custom buttons class or ID name (e.g. #my_custom_btn). And finally save the settings. In frontend now your custom button will act like a Dark Mode toggle button.

Alternatively, you can add the “darkmysite_switch_trigger()” onclick function in your button to make it work like dark mode button. e.g.

<button onclick="darkmysite_switch_trigger()">Toggle Dark Mode</button>

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer