Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
Created March 15, 2023 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damiencarbery/9c7fdc6b1289806f98f702b0bec58341 to your computer and use it in GitHub Desktop.
Save damiencarbery/9c7fdc6b1289806f98f702b0bec58341 to your computer and use it in GitHub Desktop.
For Parallax Pro theme: Add the genesis-responsive-menu class when generating page, to avoid flash of desktop menu on mobile.
<?php
/*
Plugin Name: Genesis Responsive Menu in source (Parallax Pro)
Plugin URI: https://www.damiencarbery.com
Description: For Parallax Pro: Add the genesis-responsive-menu class when generating page, to avoid flash of desktop menu on mobile.
Author: Damien Carbery
Version: 0.1
*/
add_filter( 'genesis_attr_nav-header', 'dcwd_attr_np', 10, 3 );
function dcwd_attr_np( $attributes, $context, $args ) {
$attributes[ 'class' ] .= ' genesis-responsive-menu';
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment