• Resolved Tymer007

    (@tymer007)


    Hi,

    I LOVE your plugin but I cant use it on AMP pages since its does not validate properly with it, is there a way to make it so it does not activate on AMP pages?
    AMP pages end with either /amp or /?amp
    Any way to do this?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author stefanledin

    (@stefanledin)

    Hi Tymer007!
    Thanks for loving my plugin! 😀

    I made a few tests and came up with this solution:

    1. Disable Content (and thumbnails, if needed) in the ‘Use on’ section on the RWP settings page.
    2. Add this code to your functions.php:

    
    add_action( 'wp', function() {
    	global $post;
    	if ( $post->post_name != 'amp' ) {
    		new Content_Filter( 'the_content' );
    	}
    }, 11 );
    

    This code does exactly what RWP does when it boots up, but not on pages/posts with ‘amp’ as slug.

    Thread Starter Tymer007

    (@tymer007)

    Thanks a lot for your reply, but if I disable content and thumbnails wouldnt it affect my site?

    Plugin Author stefanledin

    (@stefanledin)

    Yes, it will disable RWP on the entire site, but the code snippet will enable it again, but not on posts/pages with amp as slug.

    Thread Starter Tymer007

    (@tymer007)

    Ok I did just what you told me, thanks for spending your time “fixing” this.

    Plugin Author stefanledin

    (@stefanledin)

    No problems!
    Thanks for being a user 🙂

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

The topic ‘Responsify WP and AMP’ is closed to new replies.