Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Cannot get search to function correctly
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 7 months ago.
- AuthorPosts
- January 13, 2022 at 2:44 am #36251
Hello,
I’m a web developer and have used Ajax Search Pro in about 10 different websites. However, I cannot get it to work at all with the current site I’m working on. It’s a site under development here: https://visitcarsondev.wpengine.com/.I’ve added the search as a menu item in the main navigation menu. But, when you click the icon, the page just seems to refresh and does nothing.
Can you please have a look?
Here are my WordPress credentials:WordPress Admin: https://visitcarsondev.wpengine.com/wp-admin
Username: CVVA Admin
Password: dXsVD!MmeqpaMVj4gSg^SsM@SFTP Address: visitcarsondev.sftp.wpengine.com
Port Number: 2222
Username: visitcarsondev-adminftp
Password: C71sn0RJYSTf8
The theme we’re using is the Bridge theme.Thank you!
January 13, 2022 at 12:37 pm #36254Hi!
I believe the issue is caused by the anchor tag, where the search is printed into. Whenever the icon is clicked, the surrounding anchor also triggers, and refreshes the page.
The simplest solution is probably removing the “href” attribute programmatically. 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.
add_action('wp_footer', 'asp_custom_footer_script', 999); function asp_custom_footer_script() { ?> <script> jQuery(function($){ $('.menu-item .asp_w').closest('a').removeAttr('href') }); </script> <?php }
Please note, that this is not a plugin related issue, as a 3rd party menu tag is causing it, so I can not guarantte this will work in all scenarios.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 13, 2022 at 7:30 pm #36259You cannot access this content.January 14, 2022 at 2:15 pm #36263You cannot access this content. 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.