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

Reply To: A Quick help is needed

#34336
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Thon,

Well, you can use the same settings on the live as you used before, the code should be this one:

add_action('wp_footer', 'wp_footer_asp_custom_redirect', 9999);
function wp_footer_asp_custom_redirect() {
	?>
	<script>
	(function($){
		let url = 'https://www.khmeradverts.com/';
		
		function reattach() {
			$('input.orig').off('keydown').off('keyup');
			$('input.orig').on('keydown', function(e){
				let keycode =  e.keyCode || e.which;
				if ( keycode == 13 ) {
					e.preventDefault();
					e.stopImmediatePropagation();
					e.stopPropagation();
					location.href = url + '?s=' + $(this).val() + '&category=&location=&a=true';
				}
			});
		}
		reattach();
		setTimeout(function(){
			reattach();
		}, 100);
		setTimeout(function(){
			reattach();
		}, 300);
		setTimeout(function(){
			reattach();
		}, 1000);
	})(jQuery);
	</script>
	<?php
}

And then it should be all right there as well.