Site logo

Archived topic

Is there any new update for amp page ?

3 replies · Started by Budi on March 2, 2021

Viewing posts 1–4 of 4

Hi,

I am still having menu problem with amp page.
Is there any update ?
Thanks.

Hi there,

if you're referring to your older topic related to the Secondary nav, then no - not yet, we're currently in the process of updating GPP Premium some of which will assist with making the necessary updates required in the GP AMP plugin.

How do I add search function in primary menu for amp page ?
Something like below

<form role="search" method="get" class="search-form" action="https://xxxxx/"> <label for="search-form-1"> <span class="screen-reader-text">Search</span> </label> <input type="search" id="search-form-1" class="search-field" placeholder="Search" value="" name="s" /> <button type="submit" class="search-submit"><svg class="icon icon-search" aria-hidden="true" role="img"> <use href="#icon-search" xlink:href="#icon-search"></use> </svg><span class="screen-reader-text">Search</span></button></form>

You can use a Hook Element to add the HTML to your site.

1. Create a new Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/

2. Add this as your hook content:

<?php
if (function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) {
    ?>
    // Add your HTML or Shortcode here
    <?php
}
?>

3. Select the menu_bar_items hook
4. Check Execute PHP ( and check Execute Shortcodes if you're using them )
4. Set the Display Rules to the Entire Site.

This archived topic is closed to new replies.