Title: Improper screen-size loading
Last modified: November 8, 2021

---

# Improper screen-size loading

 *  Resolved [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/)
 * Hi,
 * I am here regarding the same screen-size issue but with some information. Now,
   I’ve realized that it’s only because of the ads I am using and not any ad plugin.
   
   [Image](https://ibb.co/CthW1Cp) This is the amp ad code I am using –
 *     ```
       <amp-ad width="100vw" height="320"
            type="adsense"
            data-ad-client="ca-pub-3613xxxxxxxxx"
            data-ad-slot="4xxxxxx"
            data-auto-format="rspv"
            data-full-width="">
         <div overflow=""></div>
       </amp-ad>
       ```
   
 * The problem is when [width = 100% of viewport] then that incorrect screen is 
   loading in amp pages don’t know why? I can edit that width, but it’ll become 
   a ‘fixed ad,’ which is not good. Even, after fixing the width, the page isn’t
   showing any ads.
 * Do you have any solution to fix this viewport issue in the amp? Is it possible
   to edit that width, and it’ll still be responsive? or set the viewport so that
   ad don’t exceed that limit?

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/improper-screen-size-loading/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/improper-screen-size-loading/page/2/?output_format=md)

 *  [Leo](https://wordpress.org/support/users/leohsiang/)
 * (@leohsiang)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15048744)
 * Hi there,
 * I could be wrong but this doesn’t sound like a theme related issue.
 * I believe this is something you will need to check with AMP’s support team.
 * Let me know if I’m missing something here.
 *  Thread Starter [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15050603)
 * Hi,
 * Even I also have no idea. The amp support said – there is a chance (not 100%)
   that the theme is causing the error, and regarding that, he has provided a recorded
   video of one of the pages. Please take a look at this [video ](https://recordit.co/Pq9SPKL8YS)
 * The ad was displayed inside the box after changing the display type. Can you 
   help me with that? I hope this can solve the issue. [link ](https://www.wikibuff.com/jalaj-saxena/?amp)
   of the page, just in case.
 *  [David](https://wordpress.org/support/users/diggeddy/)
 * (@diggeddy)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15050902)
 * Hi there,
 * try adding this CSS to your AMP custom CSS:
 *     ```
       amp-ad[type=adsense], amp-ad[type=doubleclick] {
           max-width: 100vw;
       }
       ```
   
 *  Thread Starter [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15053652)
 * Hi,
 * Thanks a lot. I guess it’s working, have a [look](https://drive.google.com/file/d/1R663OB_-yqeFY1BIT94wgePcWhtGdGbA/view?usp=sharing)
 * The pages aren’t loading smoothly, though. You can see in the video; first, it’s
   loading just like it used to be, and then the screen is getting fuller.
 * I tried loading the pages in incognito mode on Dolphin and Kiwi Browser, but 
   no difference.
 *  [David](https://wordpress.org/support/users/diggeddy/)
 * (@diggeddy)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15055246)
 * Does it do that if you remove the CSS i provided? As i cannot see why it would.
 *  Thread Starter [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15055391)
 * Without that code, the screen is showing like it used to be. Ads are exceeding
   the width, and the screen isn’t loading fully. [Image](https://ibb.co/vvRBJQp)
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15059973)
 * It almost looks like the HTML of the page is loading before the CSS. Do you have
   anything on the site that might be deferring the loading of CSS?
 *  Thread Starter [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15060931)
 * Hi,
 * I am using Autoptimize plugin. And settings are like [this](https://docs.generatepress.com/article/configuring-autoptimize/)
   only.
 * There is this one extra option which isn’t in that article. [MiscOptions](https://ibb.co/X2ywR5V)
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15061216)
 * Autoptimize is not active on AMP-pages, so it’s likely something else?
 *  Thread Starter [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15061324)
 * I don’t think I have any other plugins that can defer CSS. Here’s the [list](https://drive.google.com/file/d/1TFFfN4ER1tliwAM7A2FdsBz8qiFmnoFh/view?usp=drivesdk),
   though.
 *  [Leo](https://wordpress.org/support/users/leohsiang/)
 * (@leohsiang)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15063128)
 * Can you disable all plugins except AMP and AMP for GP to test?
 *  Thread Starter [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15063362)
 * Without ads, pages are loading smoothly. I’ve tried different ad plugins, but
   it’s happening with every other ad plugin.
 * I don’t know why.
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15063925)
 * Yes, the ads are causing the horizontal scroll.
 * The CSS that David provided fixes that horizontal scroll.
 * The issue is that the page is loading before the CSS that David provided, so 
   his fix is delayed, causing the jump you’re seeing.
 * I’m not sure what’s causing that delay – have you tried deactivating all of your
   other plugins (other than AMP and the Ad plugin)?
 *  Thread Starter [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * (@anujmakhloga)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15064820)
 * Thanks…will be back to you after eliminating the plugins one by one.
 * *just an update –
    I am getting this recommedation in the site health section
   >
 * > **Persistent object caching is not enabled**
   >  The AMP plugin performs at its
   > best when persistent object cache is enabled. Object caching is used to more
   > effectively store image dimensions and parsed CSS.
 * Don’t know if this has to do anything with the error.
 *  Theme Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/#post-15065756)
 * I don’t think that would cause the issue.

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/improper-screen-size-loading/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/improper-screen-size-loading/page/2/?output_format=md)

The topic ‘Improper screen-size loading’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/generatepress/3.6.1/screenshot.
   png)
 * GeneratePress
 * [Support Threads](https://wordpress.org/support/theme/generatepress/)
 * [Active Topics](https://wordpress.org/support/theme/generatepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/generatepress/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/generatepress/reviews/)

 * 25 replies
 * 6 participants
 * Last reply from: [Anuj](https://wordpress.org/support/users/anujmakhloga/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/improper-screen-size-loading/page/2/#post-15082072)
 * Status: resolved