Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › custom post meta data in search › Reply To: custom post meta data in search
February 12, 2019 at 4:40 pm
#21081
Keymaster
Hi,
In that case, I constructed a custom code, that might do the trick, although I am not sure. Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter('asp_results', 'asp_results_cf_replacement', 10, 1);
function asp_results_cf_replacement( $results ) {
foreach ( $results as &$r ) {
if ( isset($r->post_type) ) {
$meta = get_post_meta($r->id, 'fw_options', false);
if ( isset($meta, $meta['4-content']) ) {
$r->content = $meta['4-content'];
}
}
}
return $results;
}