• Resolved vladimirbauer

    (@vladimirbauer)


    Hello,

    Is there any option to display menu on amp pages if I’m using classic template mode?
    I don’t even have specific display location for menus on amp pages.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pascal Birchler

    (@swissspidy)

    I don’t think the plugin has an option to display a menu in Classic Mode by default, but you could certainly override the existing templates in your theme or in a child theme.

    That process is described in https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/.

    So what you can do is provide custom wp-content/themes/my-theme/amp/header.php and wp-content/themes/my-theme/amp/style.php files in your theme and display navigation menus using wp_nav_menu() in it. The style file is for adding the needed CSS for that menu.

    Hope that helps!

    Thread Starter vladimirbauer

    (@vladimirbauer)

    Thanks Pascal,

    I resolved this problem by copying templates folder from plugin to my theme root and add this in functions.php:

    add_filter( 'amp_post_template_dir', 'lc_custom_amp_templates' );
    
    function lc_custom_amp_templates() {
        $file = dirname( __FILE__ ) . '/amp';
    }

    So now I can customize amp templates (add navigation) etc.

    • This reply was modified 5 years, 10 months ago by vladimirbauer.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Menu in classic template mode’ is closed to new replies.