This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Divi Default Search not Replaceable

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Divi Default Search not Replaceable

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #41996
    MLadaniMLadani
    Participant

    Hi Ernest,

    I am using the Divi Theme and unfortunately am not able to change the default search with your genius product.

    The desktop version works fine as I am using the theme builder, however for the mobile version I am using the native divi search. I am unfortunately not able where to change it in the functions file.

    Your help is highly appreciated.

    Cheers
    Mario

    #42016
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Mario,

    Thank you very much for your kind words!

    I have looked at the front page on a mobile view, but I can’t see any default search bar there at the moment, so I am not sure where should it go or what should be replaced.

    Divi has a lot of different layouts, I believe it should let you change the header in mobile view as well. I do not recommend changing their theme files, unless you are using a child theme and you know what files to change. Divi is super versatile, and I don’t know how good of an idea is to make changes in their files.

    #42020
    MLadaniMLadani
    Participant

    Hi Peter,

    I have inserted it via shortcode now in the mobile menu, however when I click on it to search, it automatically redirects me to the search page. It seems that there is a layer over it which links me to somewhere else.

    Many thanks for your help.

    Cheers
    Mario

    #42033
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Okay, that is a progress.

    Can you please try to add a single hash “#” character as the link for the menu item? I believe the menu link is trying to redirect as it wraps around the plugin container. The hash symbol could prevent that.

    #42035
    MLadaniMLadani
    Participant

    Hi Ernest,

    Thanks for your feedback, but this is already in place. Kindly see attached screenshot.

    I am desperate.

    Cheers
    Mario

    #42038
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Okay, that means the menu must be checking that, as the link attribute is empty.
    How about trying something like “#search” in there. Maybe that does something.

    #42040
    MLadaniMLadani
    Participant

    Unfortunately, still no luck.

    Cheers
    Mario

    #42045
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Okay, let’s try something else.

    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_add_footer_script', 99999);
    function asp_add_footer_script() {
    	?>
    	<script>
    	jQuery(function($){
    		$('.asp_w_container').each(function(){
    			let $p = $(this).parent();
    			// Is this a menu perhaps?
    			if ( $p.is('a') && $p.parent().is('li') ) {
    				$p.replaceWith($("<div>" + $p.get(0).innerHTML + "</div>"));
    			}
    		});
    	});
    	</script>
    	<?php
    }

    This script will remove the link and replace it with a DIV element instead.

    #42070
    MLadaniMLadani
    Participant

    Hi Ernest,
    that worked, thank you so much. Somehow it has overflow issues. It is not as smooth. Any idea what I can do?

    cheers
    mario

    #42077
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Great, I can probably make an integration of this for the upcoming release, will see.

    I am not sure about the overflow. Can you please clarify? This code should not affect anything whatsoever regarding overflow. I didn’t notice any problems. Can you tell how can I replicate exactly?

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.