Created
January 31, 2018 09:36
-
-
Save rayrutjes/6b1de96b3687b937086428c37bf144f9 to your computer and use it in GitHub Desktop.
Add custom post type to dedicated WordPress search results page for Algolia plugin for WordPress
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 | |
// See: https://github.com/algolia/algoliasearch-wordpress/blob/master/includes/class-algolia-plugin.php#L181 | |
// To be added to the functions.php of your active theme for example. | |
add_filter( 'algolia_searchable_post_types', function( array $post_types ) { | |
$post_types[] = 'my_custom_post_type'; | |
return $post_types; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment