diff --git a/doc/utils/sphinx-config/_themes/lammps_theme/layout.html b/doc/utils/sphinx-config/_themes/lammps_theme/layout.html
index 8e0d235d55..98d25ebca1 100644
--- a/doc/utils/sphinx-config/_themes/lammps_theme/layout.html
+++ b/doc/utils/sphinx-config/_themes/lammps_theme/layout.html
@@ -48,6 +48,15 @@
+
+ {# Keep modernizr in head - http://modernizr.com/docs/#installing #}
+
+
+ {# for improved browser compatibility #}
+
+
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
{% if sphinx_version >= "1.8.0" %}
@@ -103,12 +112,6 @@
{%- endif %}
{%- endblock %}
{%- block extrahead %} {% endblock %}
-
- {# Keep modernizr in head - http://modernizr.com/docs/#installing #}
-
-
- {# for improved browser compatibility #}
-