Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › unexpected search results behaviors/display › Reply To: unexpected search results behaviors/display
Hi!
Thank you very much for all the details, it helps a lot.
Looking at the search page changes via the theme editor, I think you are trying to make the plugin print the results in it’s own container – which won’t work unfortunately, because that is only for the live results.
However, there is a way to trigger the search via a custom URL, that might work in this case. Basically, if you were to programatically set these variables, the search will trigger an auto populate with the given phrase. Try adding 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_action('init', 'asp_add_query_vars_for_auto_trigger');
function asp_add_query_vars_for_auto_trigger() {
if ( isset($_GET['s']) ) {
$_GET['asp_s'] = $_GET['s'];
$_GET['asp_id'] = 11;
}
}
However there is an issue I see, that the search “s” query variable is not set correclty. I tried to do a var_dump() via the editor, but it was always empty. Have you added a correct mod_rewrite rule to the .htaccess file when you changed the search URL?
Because without that, wordpress will only redirect, but never set the $_GET variables properly, and the code above will never work.
Also, changing the filter values from one search instances to another is not possible unfortunately. The reason being, that there is a possibility of conflict when one search instances uses completely different filter types from the other – causing completely incorrect values printed.