This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: custom post meta data in search

#21081
Ernest MarcinkoErnest Marcinko
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;
}