Last active
July 20, 2018 12:31
-
-
Save rayrutjes/2a82931e85fe608733a6727c6342f929 to your computer and use it in GitHub Desktop.
Exclude home page WordPress Algolia plugin
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 | |
// functions.php | |
define( 'CUSTOM_HOME_ID', 2 ); | |
function custom_should_index_post( $flag, WP_Post $post ) { | |
if ( $post->post_type === 'page' && $post->ID === CUSTOM_HOME_ID ) { | |
return false; | |
} | |
return $flag; | |
} | |
add_filter( 'algolia_should_index_post', 'custom_should_index_post', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment