Creating an AMP menu for the magazine Pro theme was bit of a puzzle. Like everything else, once you know it, it is not complicated any more.
AMP gives several challenges that like for instance the menu bar.
Problem:
When the AMP plugin is activated and the mobile nagation menu is not working.
here is how to fix this:
Step 1. Download the Amp plugin
Download the plugin, install en enable.
Go to the Amp tab and choose the template mode that works for you.
Step 2. register the responsive menu
Open up the function.php file and add this snippet to the file|
1 2 3 | if ( function_exists( 'genesis_register_responsive_menus' ) ) { genesis_register_responsive_menus( genesis_get_config( 'responsive-menus' ) ); } |
You can paste it just before or after the Responsive Menu function.
My code looks something like this:
Step 3 add /config/responsive-menus.php
to your theme folder
create a file named responsive-menus.php
in the config folder of your theme.
Step 4 open up your php file and paste the following in it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <?php /** * Genesis responsive menus settings. (Requires Genesis 3.0+.) */ return [ 'script' => [ 'menuClasses' => [ 'others' => [ '.nav-primary' ], ], ], 'extras' => [ 'media_query_width' => '800px', 'css' => 'nav.genesis-responsive-menu.toggled-on { display: block; }', ], ]; |