• Resolved rajanm0690

    (@rajanm0690)


    HI,

    1. I just want to make AMP url look exact same like non AMP- whether copying custom template to amp directory to enough or need to do any other work around?

    For eg: (Both need to look like same)
    Page url : /dk/
    and /dk/?amp

    2. Whether I need to add “add_theme_support” in function.php or in templates in amp directory?

    3. How to enable AMP for custom page and post templates with out manually enable in near publish or update metabox?

    We mostly using custom page templates for pages and I using Transitional template mode, please let me know what changes I need to do to make custom template look same as in AMP version

    Note: We using WP Rocket cache plugin and this is multisite

    • This topic was modified 4 years, 8 months ago by rajanm0690.
    • This topic was modified 4 years, 8 months ago by rajanm0690.
    • This topic was modified 4 years, 8 months ago by rajanm0690.
    • This topic was modified 4 years, 7 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • @rajanm0690 To answer your queries see below:

    1. I just want to make AMP url look exact same like non AMP…

    If using AMP compatible themes and plugins you shouldn’t need to make any modifications. On the other hand if using incompatible themes and plugins it may take some programmatic effort to make a website work and act in AMP as it does non AMP.

    2. Whether I need to add “add_theme_support”…

    You insert the add_theme_support function into your themes functions.php file or preferably a custom plugin so it doesn’t get overwritten during theme updates.

    3. How to enable AMP for custom page and post templates…

    If you’re serving all templates as AMP custom templates are also available in AMP. This option is in the “Supported Templates” section of the plugin settings.

    Lastly there should be no problem with WP Rocket and AMP when using a multisite install. You’re biggest challenge may be to replace the functionality and features which don’t seem compatible in AMP. Reader mode may be best at present.

    You may also be interested to know of upcoming changes to reader mode, with users soon to given a choice of selecting a compatible theme for their AMP URLs, as opposed to the standard reader mode templates. You’ll find out more below:
    https://github.com/ampproject/amp-wp/issues/4560

    Thread Starter rajanm0690

    (@rajanm0690)

    Hi,

    Thanks for replying, I notice major issue is Elementor styles, whether Elementor is not compatible with AMP?, If yes any other solution to make AMP work with Elementor?

    We using Elementor pro 2.10.0 version.

    @rajanm0690 I don’t have any experience working with Elementor and AMP unfortunately, I’m not sure of what incompatibilities there may be. Any features that output JavaScript in the front end of your site will not work as expected in AMP URLs.

    Thread Starter rajanm0690

    (@rajanm0690)

    @jamesosborne

    Like I earlier mentioned pages was bulid by Elementor page builder but in AMP verision its not taking any styles and layout from Elementor for eg (Sections, columns) Due to page broke I have disabled for all page and enable for this particular page https://egn.com/amp-home/ grids not like in non Amp.

    Thread Starter rajanm0690

    (@rajanm0690)

    And I dont find any from plugins that output JavaScript on the front end of the site.

    • This reply was modified 4 years, 7 months ago by rajanm0690.

    @rajanm0690 you would need to reach out to the Elementor team about compatibility with AMP to ensure both your non-AMP and AMP pages have visual and functional similarity.

    The alternative would be to use Reader mode.

    And I dont find any from plugins that output JavaScript on the front end of the site.

    It may be an issue with JavaScript and/or excessive CSS. AMP pages are allowed 75kb of CSS. You can go to AMP > Validated URLs and you’ll see the automatic corrections the plugin makes to the page so that it is served as Valid AMP. These are the items that need to be addressed by either the theme or plugin listed to prevent the AMP page from being invalid.

    Read more in the documentation:

    https://amp-wp.org/documentation/how-the-plugin-works/amp-validation/
    https://amp-wp.org/documentation/developing-wordpress-amp-sites/how-to-develop-with-the-amp-plugin/

    Thread Starter rajanm0690

    (@rajanm0690)

    Hi

    @reneesoffice Thanks for your reply,

    Sure, Will check to reach Elementor team too, Meanwhile I have checked validated URLs seems it removed 124 invalid markups to make page validated AMP, Mostly I see is Excessive Css , Invalid script and Invalid Inline Scripts, I aware If I am not remove those markups page will not serve as AMP, but is there I anything I can do fix these?

    @rajanm0690 thanks for your reply.

    As you may see, much could be attributed to the various scripts or styles added by your theme or plugins. You can follow the development workflow linked to above if you have development resources to help customize.

    The alternatives would be reach out to your respective theme/ plugin authors about AMP compatibility or options, and also to consider using those that are AMP-ready. Some are listed on the Ecosystem page.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Custom Template for Pages and Posts’ is closed to new replies.