Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Few questions
This topic contains 6 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 10 months ago.
- AuthorPosts
- April 15, 2021 at 12:00 pm #32739
Hi,
I have a few questions regarding Ajax Search pro.
The first one, I’ve noticed that you have Analytics of the most searched words/terms and I can add/post proposed words just below the search bar, but it has to be added manually. Is there’s a way to pull automatically those words based on the analytics, so to show the first 3 most searched terms?
The second one is that when I type in the search bar the search results are automatically displaying, but when I click on the X button it removes the typed word but it doesn’t remove/resets the shown results. How can I set that, and if it’s a bug when you’ll fix/update it?
Please refer to the files attached.
Thanks,
NikolaAttachments:
You must be logged in to view attached files.April 15, 2021 at 12:55 pm #32746Hi,
1. I’m afraid there is no option to do that, however you can modify the words displayed there via the asp_suggested_phrases hook.
2. That is an intended behavior, but there might be a way to trigger an empty search when clicking on the icon via a custom code.
Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
Best,add_action('wp_footer', 'wp_footer_empty_on_close'); function wp_footer_empty_on_close() { ?> <script> jQuery(function($){ $('.asp_m .proclose svg').on('click touchend', function(e){ $(this).closest('.asp_m').find('input.orig').trigger('input'); }); }); </script> <?php }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 15, 2021 at 1:25 pm #32747Hi Ernest,
Thanks a lot for a quick reply.
Reset on the X button worked : )I’ve checked the asp_suggested_phrases hook, where can I check the analytics to pull data from? Do you have it somewhere in the documentation where I can refer to?
Thanks once again.
Regards,
NikolaApril 15, 2021 at 2:41 pm #32750You are welcome. Unfortunately there is no technical documentation, but the class file can be found here: wp-content/plugins/ajax-search-pro/includes/classes/etc/statistics.class.php
You can use the getTop method to get the top keyords:
Best,$keywords = asp_statistics::getTop($number, $searchid, true);
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 15, 2021 at 2:44 pm #32751Great, I’ll check it.
Thanks a lot, Ernest.April 28, 2021 at 3:20 pm #32980Hi Ernest,
I have a few more questions:
1. Is it possible to search for current page content that isn’t any CPT, post, or product, just regular content, for example FAQ (title and text)
2. I’ve added a search id as a class to the section which is a Tab element, but when I’m searching, it doesn’t update, live search isn’t updating my content. I assume that this is happening because the content is in the Tab element, and by the way, I’m using Elementor.Thanks
April 29, 2021 at 6:46 am #32989Hi,
1. Do you mean like return parts of the page as individual results? That is not possible.
2. I need to see in order to be able to tell what is wrong. Can you send a link where I can take a look at this?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.