Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › CPT Title search returns no results › Reply To: CPT Title search returns no results
April 13, 2022 at 6:13 pm
#37523
Keymaster
You are welcome!
The problem with that setting is, that it applies only for user type results, and you are returning custom post types, so it does not apply there.
The only way to do that is via a custom code, although it should not be too difficult, something like this should do it:
add_filter('asp_results', 'asp_results_custom_url', 10, 1);
function custom_asp_redirect_url($results) {
foreach ( $results as $k => &$r ) {
$r->link = get_site_url() . '/agent-portal/management/agent-profile-update/?agent_ID=' . $r->id;
}
return $results;
}
Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.