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

Reply To: Search results page not found when hitting return or clicking the magnifying

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search results page not found when hitting return or clicking the magnifying Reply To: Search results page not found when hitting return or clicking the magnifying

#36204
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

That custom code should do the trick, just make sure the dash is not include in the keyword exceptions list, that will negate the effects of it.

If that does not work, try this variation instead:

add_filter( 'asp_search_phrase_before_cleaning', 'asp_replace_search_keywords', 10, 1 );
function asp_replace_search_keywords( $s ) {

  $replace = array(
    'x400' => 'x-400',       
    'x600m, x-600-m' => 'x-600m'
  );

  // ----------------------------------------
  // Do not change anything below this line
  // ----------------------------------------
  foreach ( $replace as $k => $w ) {
    $kr = explode(',', $k);
    foreach ($kr as $krk => &$krv) {
      $krv = trim($krv);
      if ( $krv == '' ) {
        unset($kr[$krk]);
      } else {
        $krv = '/\b' . $krv . '\b/u';
      }
    }
    if ( count($krv) > 0 ) {
      $s = preg_replace($kr, $w, $s);
    }
  }
  return $s;
}

The reason why nothing is happening on the results page is, beacause you have the results page live loader enabled, make sure to turn it OFF, that feature is used for a functional core results page.