Last active
February 6, 2017 15:34
-
-
Save morgyface/c1dc384c58e7f05704ce5d97c0b23744 to your computer and use it in GitHub Desktop.
WordPress | Mobile Menu using Mobile_Detect
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WordPress Responsive Mobile Menu
This works in conjunction with Mobile Detect to create a responsive hamburger side menu for WordPress themes.
First download Mobile Detect and add it to the root of the theme directory.
You will need to create three additional files to add to your theme. The first is a separate mobile style-sheet called mobile.css which will live in the theme's style-sheet directory. The second and third are two 48px x 48px icons. One being open and one being close. I'd recommend using SVG files for this.
Add the above code to the relevant locations in your theme.
Please note that styles in your global style-sheet could conflict with your mobile styles. One way round this is to move the menu styles from the global file to another, additional, style-sheet and add an else statement to the stylesheet php code. I often use desktop.css.