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

Reply To: Divi Default Search not Replaceable

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

#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.