Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Custom URL not work with result
This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko 7 years ago.
- AuthorPosts
- March 24, 2017 at 9:52 pm #12469
How open custom url when click on search result:
please see screenshot:
https://screencast.com/t/UQf05SGwpThanks
March 27, 2017 at 8:57 am #12484Hi!
Changing the URL on the results is only possible with a custom filter code for safety reasons. For example, you can access and change the URLs to anything by placing the following code to the functions.php file in your active theme directory:
In this example, all result URLs will be changed to ‘http://my-custom.url’. You can change that to anything you want.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2017 at 9:05 am #12487You cannot access this content.March 27, 2017 at 12:13 pm #12492Please note that this classifies as a customization request, so I can’t guarantee that my suggestions will work in any case.
I would probably make it into a function, and use it something like this, together with the filter:I have not tested this, I just put together based on your code. Basically you will have to change lines 35 and 38 to return the URLs you need.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2017 at 12:55 pm #12493You cannot access this content.March 27, 2017 at 7:16 pm #12501Hi!
I see what you did there, it indeed can be done with one search bar, I think. So, I’ve logged in and made a copy of the second search, and I configured it so a category drop-down box is displayed as well.
Now, I put together a javascript/php code snippet for you, which will check the chosen category, and manage the redirection based on that. This code will only work with that search instance. Basically, when the user hits enter or the magnifier icon, then this code is executed, and will check which category is selected, then redirect the page to that. You will have to copy it to the functions.php file in your theme directory, like the previous one:
It might have errors, so please make sure to check it, if you can 🙂 I hope this will work for you.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2017 at 8:43 pm #12503Hi Ernest,
Finaly after some tweek setting all works fine 🙂
Thanks a lot, great product and awnsome support !!
March 28, 2017 at 9:56 am #12508You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 28, 2017 at 10:06 am #12509Hi Ernest,
Rate done ! 🙂
Thanks again great support !
March 28, 2017 at 10:12 am #12510You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
The topic ‘Custom URL not work with result’ is closed to new replies.