• LN

    (@helene-roux-photo)


    hi,
    i tried, but i only get error 404
    in the settings, i would like to have choice between page and post, but we have no choice, i want only amp on page, not on post because i want to show all the comments. they are the essential components of my website
    i can not verify the result
    nothing is ok, disappointed, i’m obliged to delete

    • This topic was modified 5 years, 11 months ago by LN. Reason: forgot a word and a letter in a word
    • This topic was modified 5 years, 11 months ago by LN.
Viewing 1 replies (of 1 total)
  • Question About 404 Error, Suggestion For ‘post’ AMP Pages

    Hi @helene-roux-photo,
    Sorry you got a 404 error. That’s frustrating, and I understand why you’d delete the plugin.

    Where was that 404, on a post or a page? And did you see any PHP errors?

    Thanks for suggesting that we have an option to not use AMP for posts.

    Here’s a way to not have AMP display by default on posts, only on pages. This could go in your theme’s functions.php file, or a custom plugin.

    
    /**
     * Prevents posts from having an AMP page by default.
     *
     * This doesn't affect other post types, like 'page.'
     * And you can still override this default in the post's 'Publish' meta box.
     *
     * @return boolean $default Whether to support the $post by default.
     */
    add_filter( 'amp_post_status_default_enabled', function( $default, $post ) {
    	if ( 'post' === $post->post_type ) {
    		return false;
    	}
    	return $default;
    }, 10, 2 );
    

    This uses a slightly-modified snippet from this wiki page:
    https://github.com/Automattic/amp-wp/wiki/Custom-Post-Type-Support

    If you’re willing, I’d like to help you get setup with this plugin again.

    • This reply was modified 5 years, 11 months ago by Ryan Kienstra.
    • This reply was modified 5 years, 11 months ago by Ryan Kienstra.
Viewing 1 replies (of 1 total)
  • The topic ‘nothing to modify’ is closed to new replies.