NX WP Theme

Dark Mode Switch


Enable Widget

In order for the Dark Mode Switch widget to appear in the Widgets list  (Appearance -> Widgets) we need to enable it.

Code usage

If there is a need to use it in php directly, just use the above template anywhere you need.

get_template_part('template-parts/components/component', 'dark-mode-switch', ['label' = ""]);

Template Override

If you need to override the template in the child theme, you must locate the template file you want to override in the parent theme. Inside your child theme folder (usually in wp-content/themes/nx-theme-child), create the same folder structure as the parent theme. Copy the template file from the parent theme to the child theme while maintaining the directory structure.