Skip to content

Instantly share code, notes, and snippets.

@rayrutjes
Created January 31, 2018 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayrutjes/6b1de96b3687b937086428c37bf144f9 to your computer and use it in GitHub Desktop.
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
<?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