Created
March 15, 2016 10:51
-
-
Save fanfarian/f6f36304b9203d0f2f80 to your computer and use it in GitHub Desktop.
Wordpress Relevanssi search plugin with Oshin theme
This file contains 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
/* 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