• Resolved mrboats

    (@wpseiskaadmin)


    Talked to the map developer about amp but no resolution at this time. I was thinking about a workaround to ensure that the amp version of the post with a map on is not corrupted. Could I solve the problem by putting a div around the map and related stuff and then somehow hide the full div on amp pages? Something like

    <div id="hideinamp">
    [map shortcode]
    </div>

    and then hide the full div in amp? Pretty noob with jsarcpt, functions and stuff, what would it take to cleanly hide the div?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey @wpseiskaadmin

    Thanx for using our plugin 🙂

    am curious why you want to hide the map (a URL or screenshot would really help us understand)

    is the short code causing any validation errors in amp page ?

    Regards
    AzMak

    Thread Starter mrboats

    (@wpseiskaadmin)

    The reason is that the map in the post ends up looking like this: https://www.dropbox.com/s/q8xftg3oloxc1ej/map%20in%20amp.JPG?dl=0

    Hey @wpseiskaadmin

    apart from the issue in the image is there any validation issue for the page?

    you can add the div and add the following code in posts

    
    <div class="hideinamp">
    [map shortcode]
    </div>
    

    and also add these lines of code in custom CSS section of our plugin: http://take.ms/oAYhj

    
    .hideinamp {
      display: none;
    }
    
    Thread Starter mrboats

    (@wpseiskaadmin)

    This is from the Chrome console:

    Uncaught (in promise) Error: amp-iframe is already registered. The script tag for amp-iframe is likely included twice in the page.​​​
        at ka.f.assert (log.js:285)
        at pf (custom-element.js:114)
        at Ui (custom-element.js:108)
        at Ri (runtime.js:410)
        at f (amp-iframe.js:575)
        at extensions-impl.js:202
        at wa (dom.js:41)
        at xa (dom.js:87)
        at c (dom.js:86)
        at Ce (chunk.js:165)
    log.js:285Uncaught (in promise) Error: amp-sidebar is already registered. The script tag for amp-sidebar is likely included twice in the page.​​​
        at ka.f.assert (log.js:285)
        at pf (custom-element.js:114)
        at Ui (custom-element.js:108)
        at runtime.js:407
        at id (style-installer.js:59)
        at Ri (style-installer.js:45)
        at f (amp-sidebar.js:327)
        at extensions-impl.js:202
        at wa (dom.js:41)
        at xa (dom.js:87)
    log.js:285Uncaught (in promise) Error: amp-user-notification is already registered. The script tag for amp-user-notification is likely included twice in the page.​​​
        at ka.f.assert (log.js:285)
        at pf (custom-element.js:114)
        at Ui (custom-element.js:108)
        at runtime.js:407
        at id (style-installer.js:59)
        at Ri (style-installer.js:45)
        at f (amp-user-notification.js:457)
        at extensions-impl.js:202
        at wa (dom.js:41)
        at xa (dom.js:87)
    log.js:285Uncaught (in promise) Error: amp-social-share is already registered. The script tag for amp-social-share is likely included twice in the page.​​​
        at ka.f.assert (log.js:285)
        at pf (custom-element.js:114)
        at Ui (custom-element.js:108)
        at runtime.js:407
        at id (style-installer.js:59)
        at Ri (style-installer.js:45)
        at f (amp-social-share.js:96)
        at extensions-impl.js:202
        at wa (dom.js:41)
        at xa (dom.js:87)
    log.js:285Uncaught (in promise) Error: amp-analytics is already registered. The script tag for amp-analytics is likely included twice in the page.​​​
        at ka.f.assert (log.js:285)
        at pf (custom-element.js:114)
        at Ui (custom-element.js:108)
        at Ri (runtime.js:410)
        at f (amp-analytics.js:670)
        at extensions-impl.js:202
        at wa (dom.js:41)
        at xa (dom.js:87)
        at c (dom.js:86)
        at Ce (chunk.js:165)
    
    Thread Starter mrboats

    (@wpseiskaadmin)

    The solution to hide the map worked OK, thanks!

    Thread Starter mrboats

    (@wpseiskaadmin)

    And also made the errors go away.

    Hey @wpseiskaadmin

    I am happy that I could be of help 🙂

    If you like our plugin, please leave us a review

    Regards
    AzMak

    Thread Starter mrboats

    (@wpseiskaadmin)

    When I can actually put it on the production site, I’ll be happy to do so, not quite there yet 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Hide div in amp?’ is closed to new replies.