- This topic has 3 replies, 2 voices, and was last updated 2 years, 8 months ago by Ernest Marcinko.
-
AuthorPosts
-
January 13, 2022 at 2:44 am #36251netpilotweb65Participant
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 #36254Ernest MarcinkoKeymasterHi!
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.
January 13, 2022 at 7:30 pm #36259netpilotweb65ParticipantYou cannot access this content.
January 14, 2022 at 2:15 pm #36263Ernest MarcinkoKeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.