Support » Plugin: AMP » custom single for amp page

  • Resolved shalomgabay

    (@shalomgabay)


    Hi,
    I’m trying to use the Reader \ Transitional for my single pages in custom post type.
    the thing is that I want to implement my design to the amp mode page.
    what is the best way to do it? and which mode should i use?

    • This topic was modified 2 months, 1 week ago by shalomgabay.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    @shalomgabay If you are looking to use your own themes layout and style then transitional and also native mode provide what you are looking for if you are using an AMP compatible. It might take some work if you are not using an AMP compatible theme. Reader mode can be used in this instance, as it provides basic AMP valid templates for your pages and posts.

    You can also create overrides in reader mode for the default amp templates. To do so create a folder called “amp” in your active themes root directly, and then copy over any of the templates from the plugins templates folder.

    Thanks!

    I was wondering how can i include custom css for those templates.
    can it be enqueued into the custom .php that i’m ediditing?

    Plugin Support James Osborne

    (@jamesosborne)

    As you are using transitional or native mode AMP you can use your active themes stylesheets. If you want CSS applied to AMP URLs only include the html[amp] selector to any CSS rules.

    For reader mode AMP you can use a function similar to the following, added to your active themes functions.php file:

    add_action( 'amp_post_template_css', function() {
            ?>
             /* Put Custom CSS here */
            <?php
    } ); 

    thanks alot james

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.