Forum Replies Created
-
AuthorPosts
-
January 6, 2022 at 12:18 am in reply to: Search results page not found when hitting return or clicking the magnifying #36199
robratliff85
ParticipantHere’s what I’ve tried using the code you sent, but it still treats x400 like searching for x400
/* Replace Keywords */add_filter( ‘asp_query_args’, ‘asp_replace_search_keywords’, 10, 2 );
function asp_replace_search_keywords( $args, $id ) {
/**
* Add as many words as you want. On the left side place the
* word or words separated by comma to replace.
* To the right side, place the single word to replace it with.
*/
$replace = array(
‘x400’ => ‘x-400’, // Replace ‘word1’ with ‘word2’
‘x600m, x-600-m’ => ‘x-600m’, // Replace ‘word3’ and ‘word4’ with ‘word5’
);// —————————————-
// 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 ) {
$args[‘s’] = preg_replace($kr, $w, $args[‘s’]);
}
}
return $args;
}January 5, 2022 at 5:54 pm in reply to: Search results page not found when hitting return or clicking the magnifying #36196robratliff85
ParticipantThe top menu doesn’t fit correctly for the following 2 pages, but only when ajax pro search is activated. Once I deactivate ajax search pro, the page looks correct. If you give me your email, I’ll set you up with a username and password.
http://kelvinf1.sg-host.com/level-monitoring/float-sensors/
http://kelvinf1.sg-host.com/level-monitoring/pressure-sensors/January 5, 2022 at 5:16 pm in reply to: Search results page not found when hitting return or clicking the magnifying #36195robratliff85
ParticipantOne other thing you could help with. When you search for something on the search page once it’s already loaded, the results come up blank, meaning they are there and if you hover over and click on the blank space it will take you to one of the search results pages, but you just can’t see the results. Try searching for something on the search results page, but don’t hit the return key.
January 5, 2022 at 5:07 pm in reply to: Search results page not found when hitting return or clicking the magnifying #36194robratliff85
ParticipantAlso, thank you for the search results page fix. Now I’m wondering if we can make the results window taller? It’s only tall enough to show about 4 results.
January 5, 2022 at 5:01 pm in reply to: Search results page not found when hitting return or clicking the magnifying #36193robratliff85
ParticipantIs there a way to force x400 to look for x-400 and x600 to search for x-600 etc. The reason is that removing the – only caused the x-400 to now search for x400 and x400 is the keyword not working properly. But if I can force x400 to search for x-400 the the search will deliver the right results.
-
AuthorPosts