How can we help?

If you are looking for support for our Poka theme, this is the place!

Home Forums Poka v2 support Solve problem with amp validator

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  duendecasino@gmail.com 3 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2217

    Hi guys! In my google console have appeared the warning messages of the review pages in “amp” format
    It turns out that in the code of the page in “amp” there are 2 identical script “amp-carousel-0.1.js”. This is why the validator amp gives an error.
    It is a small inconvenience that the developers of the Poka Theme v2 have not reviewed, and it can be solved by eliminating the line of code in the “amp-header.php” file of its theme.

    <script async custom-element = “amp-carousel” src = “https://cdn.ampproject.org/v0/amp-carousel-0.1.js”> </ script>

    After removing this line the code solves the problem!

    See the screenshots:
    screenshot1
    screenshot2
    screenshot3
    screenshot4
    screenshot5
    screenshot6

    The new file code “amp-header.php”

    <!doctype html>
    <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
        <?php do_action( 'amp_post_template_head', $this ); ?>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
        <style amp-custom>
            <?php $this->load_parts( array( 'style')); ?>
            <?php do_action( 'amp_post_template_css', $this); ?>
        </style>
        <script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
    </head>
    
    <body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?>">
    
        <header class="amp-header">
            <div class="container">
                <a href="<?php echo esc_url( home_url() ); ?>" class="amp-logo">
                    <?php
                    if( get_field('site_logo','options') ){
                        $site_icon_url = get_field('site_logo','options');
                    } else {
                        $site_icon_url = get_template_directory_uri().'/images/logo.png';
                    }
                    ?>
                    <amp-img src="<?php echo esc_url( $site_icon_url ); ?>" layout="fill" class="amp-logo-img"></amp-img>
                </a>
                <button class="amp-toggle-menu" on='tap:sidemenu.toggle'><i class="fa fa-bars" aria-hidden="true"></i></button>
            </div>
            <!-- /.container -->
        </header>
    
        <amp-sidebar id="sidemenu" layout="nodisplay" side="left">
            <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'menu hidden-md-down', 'container' => false ) ); ?>
        </amp-sidebar>
    #2226

    admin
    Keymaster

    Hi duende!

    Thanks again for the heads up!
    Apparently with the latest version of the AMP plugin this bug occurred, it is going to be fixed in the next version of poka!

    #2236

    OK thanks! If the latest version of AMP plugin has already been added in its code the amp-carousel script, so when validating “amp page”, it gives an error and warning.

    Casinos Fortune

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.