Created
August 23, 2015 23:08
-
-
Save khromov/794fac52b3d90d8c8e43 to your computer and use it in GitHub Desktop.
WordPress Instant Articles - Prerender specific pages - https://wordpress.org/plugins/instant-articles/
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
| <?php | |
| add_filter('wpinstant_prerendered_urls', function($urls) { | |
| if ( is_front_page() ) { | |
| $posts = array( 1,2,3); | |
| foreach($posts as $post) { | |
| $permalink = get_permalink( $post ); | |
| if($permalink) { | |
| $urls[] = $permalink; | |
| } | |
| } | |
| } | |
| return $urls; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment