Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › url parameter is getting changed from ?s= to ?phrase= while implementing the plu
- This topic has 22 replies, 2 voices, and was last updated 5 years, 2 months ago by
Ernest Marcinko.
-
AuthorPosts
-
March 4, 2021 at 3:25 pm #31996
jsamal29
ParticipantHi Team,
We have implemented the AjaxSearchPro plugin in the below page of our website.
https://dev-www.motor.com/testpage/
After entering a text (e:g; seyfert) as input to the Search box when we press Enter. Then it is taking us to the page https://dev-www.motor.com/testpage/?phrase=seyfert#But actually as the WordPress default search works on Query string as “?s=” instead of “?phrase=”.
For example below Url uses default wordpress query string as “?s=” and it provides valid result.
https://dev-www.motor.com/?s=seyfertBecause of this roadblock we are not able to see the result delivered by plugin and thus we are stuck at further items such as result grouping etc.
Please let us know what can be done in order to fix the issue.
thanks
JyotiranjanMarch 4, 2021 at 3:34 pm #31997Ernest Marcinko
KeymasterHi,
Thank you for the details! Unfortunately the URL does not seem to work, I am getting the a timeout error: https://i.imgur.com/SSa0op9.png
The issue you described happens, when there is a fatal javascript error on the page caused by something, and the plugin can not properly initialize. I would try to look on the given URL on the javscript error console, but it does not open unfortunately.
March 5, 2021 at 9:16 pm #32056jsamal29
ParticipantHi Ernest,
The url https://dev-www.motor.com is actually a dev environment and thus cannot be accessible by internet.
I checked the console for any javascript conflict, I could not find any fatal javascript error. However I did found a javascript error for one of the file related to another plugin called Optinmonster (see attached screenshot)
Can you suggest something to check if the plugin works fine in any given page?Thanks
JyotiranjanMarch 6, 2021 at 8:24 am #32058Ernest Marcinko
KeymasterThat is actually a fatal error right there, and very likely the cause of the issue. Try turning off that plugin temporarily, it should resolve the problem alltogether. If that plugin as some sort of a javascript minification feature, that might be the misconfigured component causing the problem.
March 8, 2021 at 2:11 pm #32080jsamal29
ParticipantHi Ernest,
I tried both re-installing the Ajaxpro plugin and also disabling the OptinMonster plugin. Both yielded 0no result (see attached screenshot) https://imgur.com/a/sLXeQON
If I can provide screenshare then is there any way where you can guide on the same.
Thanks in advance
JyotiranjanMarch 8, 2021 at 2:45 pm #32081Ernest Marcinko
KeymasterWell, without access this is going to be very hard. Unfortunately screenshare is not an option for us.
Try the following:
– Make sure there is no duplicate of jQuery loaded. If you are using a customized theme, we have seen custom jQuery loaded to the site footer. This causes the previously loaded scripts to unload. Removing the duplication helps.
– Make sure that the wp_footer() call is present in the footer.php file in the theme directory. Custom themes or child themes tend to miss that and the scripts can not load.
– You can also try this option. If it helps, then the wp_footer() call is probably missing from the theme.March 9, 2021 at 6:14 pm #32091jsamal29
ParticipantHi Ernest,
We tried with the above suggestions on a) check for duplicate jquery and b)presence of wp_footer() in footer.php.
However we found out that the below files are not being loaded on the pages, which is resulting in non-initialization of the ajax instance in the page where the Search Box is placed.
<script type=’text/javascript’ src=’http://<server name>/wp-content/plugins/ajax-search-pro/js/min/jquery.ajaxsearchpro-sb.min.js?ver=IDdZ0m’ id=’wd-asp-ajaxsearchpro-js’></script>
<script type=’text/javascript’ id=’wd-asp-ajaxsearchpro-js-extra’>
/* <![CDATA[ */
var ASP = {“ajaxurl”:”ht ……”}We tried with multiple options available in “Compatibility Settings” section, but didnt help. Çan you guide us on what circumstances the above files can be ignored to be called?
Thanks
JyotiranjanMarch 10, 2021 at 9:43 am #32100Ernest Marcinko
KeymasterHi,
It can either happen if you have the selective asset loading enabled. If not that, then either the wp_header() of the wp_footer() calls are completely missing from the theme header and footer files. Or there is another plugin or a custom code dequeueing the assets.
March 10, 2021 at 1:00 pm #32108jsamal29
ParticipantHi,
In the location wp-content / themes / <themename>/, I checked 3 files i:e; functions.php, header.php and footer.php.
I could find wp_footer() in footer.php, but I could not find wp_header() in header.php. Could this be the reason and how to fix this?
Thanks
JyotiranjanMarch 10, 2021 at 1:06 pm #32109Ernest Marcinko
KeymasterYou may have to consult with the theme developer about that. wp_head() could be added there via inclusions as well, but he will definitely know if it’s there and if not, then what to do.
March 10, 2021 at 1:17 pm #32110jsamal29
ParticipantHi,
Also my colleague found out that there are multiple Exits that could result in non initialization of the plugin funtionality. Can you clarify on this as well?
Thanks
JyotiranjanMarch 10, 2021 at 1:21 pm #32112Ernest Marcinko
KeymasterCan you please explain what the problem is with that code? It is only the handler of the selective asset loading, it has no effect when that feature is disabled. Let me know if you find anything problematic there.
-
This reply was modified 5 years, 2 months ago by
Ernest Marcinko.
March 10, 2021 at 2:39 pm #32118Ernest Marcinko
KeymasterOne other thing popped into my mind, make sure that the wp-hooks script is not dequeued. It should be enqueued automatically, unless something else is forcefully dequeueing it. Use this to force the enqueue:
wp_enqueue_script( 'wp-hooks' );March 10, 2021 at 8:22 pm #32120jsamal29
ParticipantHi Ernest,
Can you provide some guidance on how and in which file I need to add the code to force the enqueue – wp_enqueue_script( ‘wp-hooks’ );
Thanks
JyotiranjanMarch 11, 2021 at 8:12 am #32123Ernest Marcinko
KeymasterSure 🙂 Try the functions.php file in your theme directory, that should work.
You can check if it is included, if you try searching in the frontend source code for this:
wp-includes/js/dist/hooks.min.jsIf the code work, then this file should be present somewhere.
-
This reply was modified 5 years, 2 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.