Title: Detect AMP, Edit Default reader template
Last modified: December 15, 2019

---

# Detect AMP, Edit Default reader template

 *  [Uriahs Victor](https://wordpress.org/support/users/uriahs-victor/)
 * (@uriahs-victor)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/detect-amp-edit-default-reader-template/)
 * In Transitional mode a lot of my theme’s functionality doesn’t seem to work, 
   including the drop-down menu and other things.
 * I tried reader mode and it seems to look ok for my purposes. I only need amp 
   for the SEO benefits.
 * In reader mode some of my plugins(shortcodes) still are not working because they
   depend on JS, example my slider plugin(Master Slider), so I want to create some
   fallbacks, other than checking the URL for the ?amp query in PHP, is there a 
   special constant or function I can use to know if the user is currently viewing
   the amp version of a post?
 * —
 * The other question I have is how do I go about editing the default reader template?
   By Edit I mean maybe duplicate it and change some things about it such as the
   color of the top bar and some standard formating things

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/detect-amp-edit-default-reader-template/#post-12242515)
 * You can use a condition such as the below:
 *     ```
       <?php if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) : ?>
           ...amp code here...
       <?php else : ?>
           ...non amp code here...
       <?php endif; ?>
       ```
   
 * You can also use [this plugin](https://gist.github.com/westonruter/95da1a34dd4a758e6622c6319c54a60b#file-is-amp-endpoint-shortcode-php)
   to display content via a shortcode based on an AMP URL or non.
 * As you are using the plugin reader mode you can also use the `amp_post_template_data`
   filter in your functions.php.
 * In relation to modifying the `reader` mode templates you can do so by copying
   over any of the `reader` mode [templates](https://github.com/ampproject/amp-wp/tree/develop/templates)
   and placing them in your active themes directory within a folder called `amp`.
   Any of the templates in this newly created `amp` folder will overwrite the plugins
   reader mode templates.
 *  Thread Starter [Uriahs Victor](https://wordpress.org/support/users/uriahs-victor/)
 * (@uriahs-victor)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/detect-amp-edit-default-reader-template/#post-12260793)
 * I used this guide for filtering shortcodes and it works perfect: [https://make.xwp.co/2016/08/26/integrating-amp-into-wordpress-a-comprehensive-guide/#filtering-shortcodes](https://make.xwp.co/2016/08/26/integrating-amp-into-wordpress-a-comprehensive-guide/#filtering-shortcodes)
 * What I plan to do is wherever a Masterslider shortcode occurs in the content,
   I will replace it with some text saying something like
 * “To view this slideshow please click here to view full blog post.” The link would
   go to the non-amp blog post.
 * As I said I mostly want to use AMP for the SEO benefits since google is pushing
   AMP posts so hard. But I have several articles with Masterslider shortcodes already.
 * So I’m wondering if having such a replacement note inside my posts whenever certain
   shortcodes are not supported for amp, would be a violation of any amp policy 
   or something?
 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/detect-amp-edit-default-reader-template/#post-12264675)
 * [@uriahs-victor](https://wordpress.org/support/users/uriahs-victor/) Nice article.
   The shortcodes in the mentioned [plugin](https://gist.github.com/westonruter/95da1a34dd4a758e6622c6319c54a60b#file-is-amp-endpoint-shortcode-php)
   don’t violate any AMP principles. It’s no problem to place that notice you specific
   for your AMP content in either the condition or the plugin.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Detect AMP, Edit Default reader template’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/detect-amp-edit-default-reader-template/#post-12264675)
 * Status: not resolved