• Resolved adil1641

    (@adil1641)


    hi, i have installed amp plugin. After installation, I saved the permalinks. I also declared this in functions.php
    mytheme_add_amp_support() {
    add_theme_support( ‘amp’ );
    }
    but nothing works? please suggest me what to do? and what is the procedure of using this? I have developed the site in wordpress. I want that after installing amp plugin. Site should be shown in amp version.
    please suggest me what to do?

    I found from this link that if you are using cms then follow this
    https://www.ampproject.org/docs/getting_started/quickstart#using-a-cms?

    • This topic was modified 6 years, 4 months ago by adil1641.
Viewing 15 replies - 1 through 15 (of 42 total)
  • Thread Starter adil1641

    (@adil1641)

    Is there any suggestion?

    Thread Starter adil1641

    (@adil1641)

    No support or any suggestion for the problem. This is not good thing. ??

    Hi @adil1641,
    Sorry for the delay.

    You’ve probably read this wiki page, but this has many of the details about adding theme support:

    https://github.com/Automattic/amp-wp/wiki/Adding-Theme-Support

    Do you see this on the AMP settings page?

    Amp theme support

    Thread Starter adil1641

    (@adil1641)

    hi, I have a question? Should I use only this code in functions.php
    add_theme_support( ‘amp’);
    or I embed this in functions Like this
    function mytheme_add_amp_support() {
    add_theme_support( ‘amp’);
    }
    add_action( ‘after_setup_theme’, ‘mytheme_add_amp_support’ );

    please suggest me?

    Plugin Author Weston Ruter

    (@westonruter)

    @adil1641 Either will work.

    Thread Starter adil1641

    (@adil1641)

    Hi, @westonruter after applying this in functions.php
    or
    function mytheme_add_amp_support() {
    add_theme_support( ‘amp’);
    }
    add_action( ‘after_setup_theme’, ‘mytheme_add_amp_support’ );

    then in wordpress admin, it is showing as below
    https://www.creativesystems.com/wp-content/uploads/amp-test/amp-settings.PNG

    but my site frontend is disturbed, you can show in this link
    https://www.creativesystems.com/wp-content/uploads/amp-test/amp-site.PNG
    please suggest me what to do?

    one more thing
    how to see the amp version?

    please suggest me the solutions of these questions?

    Plugin Author Weston Ruter

    (@westonruter)

    @adil1641 It appears your theme has more CSS than AMP allows. When using v0.7 of the plugin, it does not minimize the CSS. This is a feature introduced in 1.0. You can see the plugin version on the plugins screen in the admin. I suggest trying 1.0-beta1: https://make.xwp.co/2018/07/06/amp-plugin-release-v1-0-beta1/?amp

    Thread Starter adil1641

    (@adil1641)

    means this is 1.0 beta version. It will introduce in future. Am I Right?
    currently 0.7 version is showing in admin section.

    Plugin Author Weston Ruter

    (@westonruter)

    It is available now for testing. You can download the plugin ZIP from that blog post. The latest stable release on www.ads-software.com is 0.7, yes.

    Thread Starter adil1641

    (@adil1641)

    Hi, after installing 1.0-beta1 version.
    1) In the amp settings, which mode i will use. this is the link you can see here
    https://www.creativesystems.com/wp-content/uploads/amp-test/template-mode.PNG

    2) should i use this code also in functions.php
    function mytheme_add_amp_support() {
    add_theme_support( ‘amp’);
    }
    add_action( ‘after_setup_theme’, ‘mytheme_add_amp_support’ );

    3)and from where i can see amp version?

    4) Is there any way that my theme does not disturb and amp version automatically embeded in it?

    please suggest me the solution of these four questions as soon as possible?

    • This reply was modified 6 years, 4 months ago by adil1641.
    Plugin Author Weston Ruter

    (@westonruter)

    You do not need to add the add_theme_support('amp') call in 1.0-beta1. You can instead switch from “Classic”?to Paired or Native. When you switch to Paired mode, you can find the AMP version of a given URL by looking at the admin bar on the frontend as there will be a link to the AMP version. Otherwise, you can look for an amphtml link in the page source, but when in Paired mode then you can just add ?amp to any URL to access the AMP version.

    Thread Starter adil1641

    (@adil1641)

    hi, after switching to paired mode and removing add_theme_support(‘amp’) and applying ?amp in the end of link. link changes to
    https://localhost/creative-systems/?amp_validation_errors=73 . how can i fix this?
    because in amp validations page in admin. errors are not showing

    Plugin Author Weston Ruter

    (@westonruter)

    There should be a link in the admin bar to re-validate AMP for that URL so that you can see what specifically the validation errors are. 73 is quite a lot.

    If you want to automatically accept validation errors for sanitization, you can do so on the general settings screen as well, the checkbox for “Automatically accept sanitization for any AMP validation error that is encountered.” under Validation Handling.

    Nevertheless, do note that sanitizing a validation error means that the offending element or attribute is going to be removed. That may result in the page not behaving properly. So you’ll want to test the page in your browser to see if the sanitization is acceptable.

    Thread Starter adil1641

    (@adil1641)

    hi,
    1) After checking the checkbox for “Automatically accept sanitization for any AMP validation error that is encountered.” under Validation Handling. I check the url with ?amp. site’s css is not loading properly. you can see here
    https://www.creativesystems.com/wp-content/uploads/amp-test/amp-page.PNG

    2) There is no link in the admin bar to re-validate AMP for that URL. you can see here
    https://www.creativesystems.com/wp-content/uploads/amp-test/amp-general-settings.PNG

    please suggest me what to do with this error?

    Plugin Author Weston Ruter

    (@westonruter)

    @adil1641 The admin bar link to re-validate would be on the frontend, not in the backend. But from your amp-page.png screenshot I don’t see the admin bar being displayed there at all. If you look at the source code for he AMP version of a page you’ll see a <style amp-custom> element, and right before it you’ll see an HTML comment that lists out the stylesheets that are being (attempted) to be included. Once the sum of stylesheets goes over 50KB (the limit in AMP) then it will just exclude the CSS, and this is probably why your site looks unstyled.

    Please share the HTML comment that lists out the stylesheets.

Viewing 15 replies - 1 through 15 (of 42 total)
  • The topic ‘how to use Amp?’ is closed to new replies.