Skip to content

Instantly share code, notes, and snippets.

@fanfarian
Created March 15, 2016 10:51
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 fanfarian/f6f36304b9203d0f2f80 to your computer and use it in GitHub Desktop.
Save fanfarian/f6f36304b9203d0f2f80 to your computer and use it in GitHub Desktop.
Wordpress Relevanssi search plugin with Oshin theme
/* Additional content from Oshin page builder is not indexed with the Relevanssi search plugin
* The Oshin page builder stores it's content in the 'wp_postmeta' table
* The function adds this content to the relevanssi index
*
* Oshin: 3.1 (http://brandexponents.com/oshin/)
* Relevanssi: 3.5.2 (http://www.relevanssi.com/)
*/
function add_extra_content($content, $post) {
global $wpdb;
$content = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE post_id = $post->ID AND meta_key = '_be_pb_content'");
return $content;
}
add_filter('relevanssi_content_to_index', 'add_extra_content', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment