diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index d7e91666..1c28f3ab 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -49,7 +49,7 @@
localStorage.setItem("menu-scroll-position", document.getElementById('menu').scrollLeft);
}
-{{- if not .Site.Params.disableThemeToggle }}
+{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }}
-{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index f67f33bc..40e7b15f 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,4 +1,4 @@
-{{- if eq .Site.Params.defaultTheme "auto" }}
+{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }}
{{- end }}
+{{- if (and (.Site.Params.disableThemeToggle) (eq .Site.Params.defaultTheme "auto")) }}
+
+{{- end }}