
When using wp_redirect() you will facing Header error “PHP Warning: Cannot modify header information – headers already sent by …… wp-includes/pluggable.php on line 1228”
To solve this problem you need to change the PHP.ini value. In PHP.ini find


var ajaxurl = '<?php echo admin_url() ?>admin-ajax.php';
jQuery(document).ready(function () {
jQuery.ajax({
url: ajaxurl,
data: {
//This action must same with the PHP function name
"action": "ajax_request",
"params": "wordpress ajax"
},
success:function(data) {
//This is the result return from PHP function
console.log(data);
},
error: function(errorThrown){
//This is the error return
console.log(errorThrown);
}
});
});

my-first-plugin << Folder name - my-first-plugin.php << main PHP file name

<a href="../contact/" >Contact Us</a>But it was bad way.
<a href="http://chevronscode.com/contact/" >Contact Us</a>

$mySearch =& new WP_Query("s=$s & showposts=-1");
$num = $mySearch->post_count;
echo $num. "results";
But unfortunately, sometimes it still gave me the wrong count.