• Resolved unnamed

    (@yazarmfa)


    Hi,

    I want to add google play app banner at the beginning of amp pages. It’s explained in this link, but I can’t do it because I don’t have code knowledge.

    https://amp.dev/documentation/components/amp-app-banner/

    Is there a single code I can add between <head> and </head>? Or what do I need to do to add it to my Worpress site?

    Can you help me?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @yazarmfa

    Thank you for the support topic, I will recommend contacting a developer because it needs some technical expertise to implement amp-app-banner.

    You may consider AMP Expert listed on our site.

    You can add <amp-app-banner> in your WordPress site using wp_body_open hook.

    eg:

    
    add_action( 'wp_body_open', 'insert_amp_app_banner' );
    
    function insert_amp_app_banner() {
    ?>
    <amp-app-banner layout="nodisplay" id="demo-app-banner-2134">
        <amp-img src="https://example.com/icon.png" width="60" height="51">
        </amp-img>
        <h3>App Name</h3>
        <p>Experience a richer experience on our mobile app!</p>
        <div class="actions">
          <button open-button>Get the app</button>
        </div>
      </amp-app-banner>
    <php
    }
    

    The scripts that are required to add amp-app-banner will be automatically included.

    Hope this helps!

    Plugin Support Milind More

    (@milindmore22)

    @yazarmfa
    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

    Thread Starter unnamed

    (@yazarmfa)

    Hi, it gave an error when I tried to add the one you gave.

    I’m sorry I didn’t reply as I gave up hope.

    When I tried to add functions.php to the code you gave using Code Snippets, it gave an error as in the picture I gave.

    https://muhammedfurkanakdogan.com.tr/error.png

    I think there is something wrong in the code.

    Finally there is no link to my google play app in this code.

    https://play.google.com/store/apps/details?id=tr.com.muhammedfurkanakdogan.twa

    Plugin Support Milind More

    (@milindmore22)

    Hello @yazarmfa

    Yes, the code has a syntax error, The correct code will be as below

    add_action( 'wp_body_open', 'insert_amp_app_banner' );
    
    function insert_amp_app_banner() {
    ?>
    <amp-app-banner layout="nodisplay" id="demo-app-banner-2134">
    <amp-img src="https://example.com/icon.png" width="60" height="51">
        </amp-img>
        <h3>App Name</h3>
        <p>Experience a richer experience on our mobile app!</p>
        <div class="actions">
          <button open-button>Get the app</button>
        </div>
      </amp-app-banner>
    <?php
    }
    
    add_action( 'wp_head', 'insert_app_mainefest' );
    
    function insert_app_mainefest() {
    	?>
    	<meta
        name="apple-itunes-app"
        content="app-id=123456789, app-argument=a://link/to/app-content"
      />
      <link rel="manifest" href="https://link/to/manifest.json" />
    	<?php
    }

    please replace with default data with your data in above example.

    Also, it will be best to approach AMP support (this just support for WordPress AMP plugin and not AMP technology) on how you can implement that on your site, as this may need some configuration changes in App too, we will advise getting help from the expert as we are can not advise you with App development

    Sorry, we can’t be much of help on this one!

    Thread Starter unnamed

    (@yazarmfa)

    Thanks…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Amp Google Play App Banner’ is closed to new replies.