You’ve got an expected error because I cannot find any input field with kind
name. There’s only action
, region
and street
no sign of kind
!
Notice: Undefined index: kind in
/home2/khiyabou/domains/khiyaboun.ir/public_html/wp-content/themes/khiyaboun-1/examplefile.php
So the above error is a perfect error in this situation. Please rewrite your callback function like the following. Hope that’ll work
// It'll work for only street
function cat_filter_posts() {
if ( isset( $_POST['street'] ) && 'none' != $_POST['street'] ) {
$posts = new WP_Query( array(
'type' => 'post',
'category_name' => $_POST['street']
) );
}
}