Disabled AMP by default for posts
-
Hello,
For a News site, I would need to disable AMP by default on all articles, leaving me the choice to choose which ones will be displayed in AMP version later.
To do this I used this code found on the documentation by replacing “xyz-review” with “post”:add_filter( 'amp_post_status_default_enabled', function( $default, $post ) { if ( 'xyz-review' === $post->post_type ) { $default = false; } return $default; }, 10, 2 );
Except that, in the wordpress back-panel the articles seem to be deactivated but when I test with the URL “?amp” the articles load well in AMP and do not seem to be deactivated.
Do I have to do something more? Is it a bug?Thank you in advance.
Sincerely.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Disabled AMP by default for posts’ is closed to new replies.