Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Custom URL not work with result
- This topic has 9 replies, 2 voices, and was last updated 9 years, 2 months ago by
Ernest Marcinko.
-
AuthorPosts
-
March 24, 2017 at 9:52 pm #12469
ilanb
ParticipantHow open custom url when click on search result:
please see screenshot:
https://screencast.com/t/UQf05SGwpThanks
March 27, 2017 at 8:57 am #12484Ernest Marcinko
KeymasterHi!
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.
March 27, 2017 at 9:05 am #12487ilanb
ParticipantYou cannot access this content.
March 27, 2017 at 12:13 pm #12492Ernest Marcinko
KeymasterPlease 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.
March 27, 2017 at 12:55 pm #12493ilanb
ParticipantYou cannot access this content.
March 27, 2017 at 7:16 pm #12501Ernest Marcinko
KeymasterHi!
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.
March 27, 2017 at 8:43 pm #12503ilanb
ParticipantHi Ernest,
Finaly after some tweek setting all works fine 🙂
Thanks a lot, great product and awnsome support !!
March 28, 2017 at 9:56 am #12508Ernest Marcinko
KeymasterYou cannot access this content.
March 28, 2017 at 10:06 am #12509ilanb
ParticipantHi Ernest,
Rate done ! 🙂
Thanks again great support !
March 28, 2017 at 10:12 am #12510Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Custom URL not work with result’ is closed to new replies.