=== AMP Sidebar Hamburger Menu === Contributors: jamesosborne Tags: amp-sidebar, amp sidebar, navigation menu, navbar, amp navigation, hamburger dropdown, dropdown navigation menu Requires at least: 4.0 Tested up to: 5.5.3 Stable tag: 1.2.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html == Description == If you're using a WordPress theme that is not AMP compatible you may find your JavaScript based navigation menu isn't working. This plugin provides you with an easy to implement fix. It works in both AMP and non AMP, using an optional jz-sidebar shortcode or a code snippet into your existing hamburger menu. If you're using the official AMP plugin there are options to display the button on AMP URLs only, and it works in reader mode without having to add a shortcode or place a snippet. Install, active and check your AMP URLs. If you're using AMP in transitional or standard mode check the FAQ's below, or follow the instructions in the settings tab after installing. Features:
[jz-sidebar]or insert into your theme files using
Note: If you prefer to use your existing navigation menus button simply add the following attributes to your navigation button:
Note: You should perform the above using a child theme, so any changes don't get overwritten. As an alternative to the shortcode above if you wish to add the attributes directly into your navigation menu you can apply the below attribute into your existing button:on="tap:sidenav.open" role="button" tabindex="0"
[jz-sidebar]
If you wish to place the shortcode into your theme templates you can do so by adding the below, wherever you choose. For best results find the location of your existing hamburger menu, and apply the following:
If you want to use your existing hamburger menu for AMP URLs and use this plugin the below can be added as an attribute to your existing button. Please backup your site first:
= Can I use my existing themes navigation button / hamburger menu? =
Sure, you'll need to add the below code snippet in between your button markup. If you’re unable to locate your themes navigation menu button check with your theme developer. You simply need to add the below in as an attribute to your existing button.
= I don't know where to place it in my theme files? =
If you’re unsure where to place the data attribute to use with your existing navigation menu check with your theme developer.
Bear in mind this plugin may not be required at all if your theme supports AMP. So be sure to ask your theme developer if they have AMP compatibility plans first.
= Should I use a child theme? =
Using a child theme is highly recommended. You never know when things go wrong. In addition to safeguarding against mishaps theme updates won’t overwrite your additions.
= Should I perform a backup first? =
Of course, performing regular backups is general best practice. I don't take any responsibility for site issues due to misconfiguration, or shortcode misplacement.
= Can I use this plugin for my non AMP site? =
Good question - yes, you can. If you are looking to use this for your non AMP site you should select the “AMP & Canonical” option from the configuration settings. You’ll need to place the shortcode or navigation menu attributes into your theme files (preferably via a child theme)
= I'm using AMP in reader mode, where do I apply the code snippet or shortcode? =
If using the AMP plugin in reader mode you are making use of the AMP plugins classic templates. The hard work is all done, simply install and activate the plugin before checking your reader mode AMP urls.
One thing to note when using reader mode, the amp-sidebar hamburger menu will not be added to your non AMP urls until you place the shortcode into your child themes templates. The “AMP & Canonical” option is redundant, unless of course you decide to add the shortcode to your theme.
= Can I use it to replace my existing WordPress menu? =
Sure, but you’ll have to locate your existing navigation menu and replace it with this hamburger menu. Note that this plugin only offers a hamburger menu. There is no support for a horizontal dropdown menu.
= I don’t like the styling, how do I change it? =
You can apply CSS as you would normally, to your active themes style.css file,your themes “custom CSS” field, or preferably a custom plugin.
= It's not working, what can I do? =
Perform the following checks or considerations: