Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Display results as default
- This topic has 8 replies, 2 voices, and was last updated 6 years ago by
Ernest Marcinko.
-
AuthorPosts
-
April 21, 2020 at 11:03 am #26823
wallytor72
ParticipantHello,
I would like to know if they’re an option to display all the results as default, I was looking at the configuration but did not find any solution for this, is this possible??
also, how can I change the landing page of the result, I mean when I click on the result I need to be a different page
thanks
April 21, 2020 at 2:34 pm #26828Ernest Marcinko
KeymasterHi,
The auto populate feature can display results during the page load. I would not recommend displaying all the results at the same time, it may slow down the users browser greatly.
The result links are requested from WordPress, so optimally you should change them there, but you can use custom code if you want to make specific changes to them.
April 21, 2020 at 2:56 pm #26831wallytor72
ParticipantHello, thanks for your quick answer, it helped me a lot
May 20, 2020 at 11:13 am #27448wallytor72
ParticipantHello Again
I was using the custom code to change the results on the search but it change to all the search result in the entire page, Can i do this just for one search ID, example in this page i have 2 search but i just want to change this search result.
At the bottom of the page
http://kiva.weareinhouse.com/leadership-and-team/thanks
wallyMay 20, 2020 at 12:59 pm #27454Ernest Marcinko
KeymasterHi,
Sure, it depends on your custom code. Can you please copy/pase it here? I will take a look.
May 20, 2020 at 2:30 pm #27463wallytor72
ParticipantI was using this,`but it change all the result pages of the search in the site, as i have 2 different ones then it change for 2 but i need that this change apply in a just one search
add_filter( ‘asp_results’, ‘asp_custom_link_results’, 1, 1 );
function asp_custom_link_results( $results ) {
// Parse through each result item
foreach ($results as $k=>$v) {
/**
* In this context the
* $results[$k]->link
* variable holds the result link. Make modifications to that variable.
*/
$results[$k]->link = ‘#’;
}return $results;
}May 20, 2020 at 2:54 pm #27464Ernest Marcinko
KeymasterHi,
In that case, this variation will pass the search ID as an argument, so you can check that in the code:
add_filter( 'asp_results', 'asp_custom_link_results', 10, 2 ); function asp_custom_link_results( $results, $search_id ) { if ( $search_id == 1 ) { foreach ($results as $k=> &$r) { $r->link = '#'; } } return $results; }May 20, 2020 at 6:52 pm #27470wallytor72
Participantgreat!! this worked,
thanks!!May 21, 2020 at 12:59 pm #27485Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.