Toggle a Page’s Color and Content

Hi. I want to make my website have the option to change the background color and H1 …(like you make in UI THEME) by pressing a button in the menu and save the option in cookie. I found this code, but I can not get it to work.

The color of the PRO theme is kept transparent.

HTML
    <label for="lightswitch">Light Switch</label>
    <input type="checkbox" id="lightswitch" />

CSS
    /*Switched Off*/
    .input#lightswitch:checked + .body {
      background: #222 !important;
    }

    .input#lightswitch:checked + .body h2 {
      color: #ddca7e !important;
    }

    .input#lightswitch:checked + .body h2:after {
      content: " Off"
    }

    .input#lightswitch:checked + .body p {
      color: #aaa !important;
    }

Please help with this.
Thanks for the best theme for WP.

Hello @jacquelinemq,

Thanks for writing in!

What you have in mind requires the HTML, CSS and most important is the Javascript that saves the cookie. Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself.

If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries.

Thank you for your understanding.

Thank, I find this solution: https://wordpress.org/plugins/wp-night-mode/

Hey @jacquelinemq,

We are just glad that you have figured it out a way to achieve what you have in mind.
Thanks for letting us know!

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.