Many, if not all of StudioPress’s older themes flash up the full menu for a glimpse before the responsive hamburger comes in.
This doesn’t look great but is easy to fix in 2 steps.
First, tweak the CSS so that the start of the responsive section reads
body.js .genesis-nav-menu { display: none; }
the responsive section may for instance start @media only screen and (max-width: 800px) {
And the add the plugin ‘Genesis JS / No JS’ by the every well respected Gary Jones https://en-gb.wordpress.org/plugins/genesis-js-no-js/
However, you may not want to add yet another plugin, and the code is simple to add to your functions.php, thi sis my version of Gary’s code and does the job just fine.
add_filter( 'body_class', function ( $classes ) { $classes[] = 'no-js'; return $classes; } ); add_action( 'genesis_before', function () { ?> <script> //<![CDATA[ (function () { var c = document.body.classList; c.remove('no-js'); c.add('js'); })(); //]]> </script> <?php }, 1 );
Leave a Reply