Created
May 16, 2017 11:49
-
-
Save MARQAS/65e8181b3fcb10b1fe718d9dcd742a9e to your computer and use it in GitHub Desktop.
Filter to Hide bulk posts in AMP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'amp_skip_post', 'ampforwp_skip_amp_post', 10, 3 ); | |
| function ampforwp_skip_amp_post( $skip, $post_id, $post ) { | |
| $ampforwp_skip_posts_in = array(postid1, postid2, postid3, ....,postidn); | |
| if( in_array( $post_id, $ampforwp_skip_posts_in ) ) { | |
| $skip = true; | |
| } | |
| return $skip; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment