Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Trying to set up customer ULR in "Search Button"
This topic contains 5 replies, has 2 voices, and was last updated by MikeGraci 4 years, 7 months ago.
- AuthorPosts
- October 22, 2018 at 10:21 pm #19560
I am trying to use customer ULR.
I put code in functions.php—was expecting a drop down to appear with values.
Perhaps validate my understanding–I was expecting to hit search icon and see a list of linkable options (value1, value2, value3, etc.)
not clear to me –what to put in configuration (See atatched)
Thanks
<?php
// — !! ONLY COPY THE CODE BELOW THIS LINE !! —
// Use this to change the “redirect to url” parameter
add_filter( ‘asp_redirect_url’, ‘asp_add_params_to_url’, 1, 10 );
// Use this to change the “show more results url” parameter
add_filter( ‘asp_show_more_url’, ‘asp_add_params_to_url’, 1, 10 );
function asp_add_params_to_url( $url ) {
// Array of param names and values
$values = array(
“param1” => “value1”,
“param2” => “value2”,
“param3” => “value3”
);
// Merge them together
foreach ( $values as $k => $v )
$url .= “&”.$k.”=”.$v;return $url;
}
view rawfunctions.php hosted wiAttachments:
You must be logged in to view attached files.October 23, 2018 at 10:42 am #19572Hi!
This custom code is not for this purpose, it will not change the layout of the search in any way. This is only to be used, when you want to add additional static parameters to the redirection URL (when the enter/magnifier is clicked), but it will not change anything within the search bar.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 23, 2018 at 1:17 pm #19578Thanks Ernest—perhaps you can weigh in here.
Attached is the search box I have…what I am trying to get to is like the other screens shots (this is off of LISTABLE Theme). Is there anyway I can add a triangle marker to “your” search box and then “pre-populate” with a given set of URSL—like one in listable?
Will take any advice you can offer…is there any similar capability in your plugin….and/or is it a realistic customization?
Thanks
Attachments:
You must be logged in to view attached files.October 25, 2018 at 2:19 pm #19624You cannot access this content.October 25, 2018 at 2:30 pm #19625Hi Mike,
Sorry about the late response. I read your ticket last night, I forgot to answer.
Best,
My honest conclusion is, that his would be very difficult to achieve without major customizations. I have looked up the filters, to maybe somehow use the built-in ‘chosen’ script to achieve something similar, (I have looked trough their whole API) but it does not have the capabilities either. The only option is a complete customization in my opinion.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 25, 2018 at 2:34 pm #19626You cannot access this content. - AuthorPosts
You must be logged in to reply to this topic.