Cannot get search to function correctly

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 Ernest Marcinko 2 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36251
    netpilotweb65
    netpilotweb65
    Participant

    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!

    #36254
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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 :)


    #36259
    netpilotweb65
    netpilotweb65
    Participant
    You cannot access this content.
    #36263
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.