-
Notifications
You must be signed in to change notification settings - Fork 279
AMP testing
Miscellaneous notes on developing AMP for child themes.
-
The WP AMP plugin stores data about images and more as transients. If you've made a change to your content and don't see it reflected in the AMP version of the site immediately, try clearing your transients. (
wp transient delete --all
or https://wordpress.org/plugins/transients-manager/) -
When developing locally: if you see no validation warnings at all, and image sizes appear incorrect, it may be that PHP can't make requests to your local site due to a certificate error or DNS issue. You can try: adding 127.0.0.1 as the first resolver in your network settings (Mac), and disabling https for your local site.
-
Testing AMP locally does not require HTTPS.
-
If the layout appears broken, try disabling the admin bar via the AMP plugin settings. Also disable plugins that output additional UI on the front end, such as Query Monitor.
- Check out the
feature/amp
branch of Genesis Sample. - Install and activate the AMP plugin: https://wordpress.org/plugins/amp/
- Install and active the Genesis AMP plugin fork from this branch:
git clone https://github.com/nickcernis/genesis-amp
thengit checkout suppress-theme-fixer
, or download at https://github.com/nickcernis/genesis-amp/archive/suppress-theme-fixer.zip This plugin fixes AMP validation errors in Genesis itself. This functionality will later be moved to Genesis 3.0. - Visit AMP → General at /wp-admin/admin.php?page=amp-options and enable “Transitional” mode. You can then view the AMP version of your site by visiting any page and appending ?amp.
An alternative is to set the mode to “Native” and follow the steps and plugin here: https://github.com/studiopress/genesis-amp/wiki. This lets you view your site as AMP by default, and view the non-AMP version by appending ?non-amp to the URL.
Visit AMP → Validated URLs.