• Resolved mohammedmalleck

    (@mohammedmalleck)


    So I created a custom dark and light theme functionality in your theme and it is working fine in local version but when I move this site live and try to open customiser to edit css i get this error
    The theme directory "dark"(or "light" in some cases) does not exist.

    Which makes me think maybe added classes to your theme html element is causing some issues…

    I tried changing class names from dark-theme to mode-dark e.t.c
    I also tried this code but nothing changed

    // Handle customizer loading function fix_customizer_theme_redirect() {
    if (is_customize_preview()) {
    add_filter('stylesheet', function() { return 'kadence'; });
    add_filter('template', function() { return 'kadence'; }); }
    }
    add_action('init', 'fix_customizer_theme_redirect');

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there!

    This topic has been resolved, but there isn’t a confirmation of which resolution was done.

    The Kadence Pro add-on has its own light/dark mode options. You can see the overview here – How to use the Color Palette Switch (Dark Mode)

    Let us know if you have any other concerns.

    Thread Starter mohammedmalleck

    (@mohammedmalleck)

    Hi @karlalevelup ,
    So I had a cookie name called “theme” for saving dark and light state , which caused the issue.

    To cut a long story short, it turned out that when I added the site theme switcher I went for the rather generic cookie name “theme”, and it also turns out that the WordPress theme customiser uses this cookie as well.
    So, lesson learned, use specific cookie names, even if you’re building your own website, because you never know when a conflict will arise

    More about it here

    • This reply was modified 1 year, 7 months ago by mohammedmalleck. Reason: trying to highlight the quote
    • This reply was modified 1 year, 7 months ago by mohammedmalleck. Reason: highlight the quote
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding class to html element doest not open customiser’ is closed to new replies.