my ajax wont sent the data, please correct my code

function kategori(){ //alert(kategori2); jQuery.ajax({ url: MyAjax.ajax_url, type: “POST”, data: { action: “berubah”, kategori: “berita” }, success : function(response) { console.log(response); //Acess whatever you sent from the back-end with response.data.%var_name% }, error: function(data ) { console.log(response); } }); } function berubah() { $kategori = $_POST[‘kategori’]; wp_send_json_success( $kategori, 200 ); } Use wp_send_json_success. Response I got: {“success”:true,”data”:”berita”}

wordpress ajax search posts

You are using post_permalink() that is deprecated. Please use get_permalink() or the_permalink() and also make sure that ajax function is called successfully by simply returning any string from ajax function.

Using category and its sub-categories products attributes as filter in products pages

It’s possible to do it with Advanced AJAX Product Filters plugin. It allows you to use attributes in the filter. Follow these steps: Install and activate the plugin. In the right sidebar, click on Widgets. Under Filter By option, select Attribute. Under Atrribute option, which is located beside Filter By, choose the attribute of your … Read more