I am using Post Grid plugin to display a catalog for a record company using custom post types and taxonomies. They want to be able to filter by artist and genre on the front end, and I have looked at the Post Grid documentation to find a shortcode php file that you can use to add this to a widget in my sidebar. I've gotten most everything to work, it shows up in the sidebar widget using the shortcode i generated, the 2 dropdowns are there for artist and genre, and they correctly populate in the dropdown based on the current taxonomies present. I can NOT for the life of me figure out how to make it actually filter the data after pressing 'submit' and it just shows everything unfiltered. Here is the code I am using.
'artist',
'hide_empty' => false,
) );
//var_dump($terms);
$pgs_artist = isset($_GET['pgs_artist']) ? sanitize_text_field($_GET['pgs_artist']) : '';
?>
term_id) ? $term->term_id : '';
$term_name = isset($term->name) ? $term->name : '';
?>
<option value="">
'genre',
'hide_empty' => false,
) );
//var_dump($terms);
$pgs_artist = isset($_GET['pgs_genre']) ? sanitize_text_field($_GET['pgs_genre']) : '';
?>
term_id) ? $term->term_id : '';
$term_name = isset($term->name) ? $term->name : '';
?>
<option value="">
<?php
}
// Process form data and post query
function post_grid_query_custom_search($query_args, $args){
$current_post_id = get_the_ID();
$pgs_artist = isset($_GET['pgs_artist']) ? sanitize_text_field($_GET['pgs_artist']) : '';
$pgs_genre = isset($_GET['pgs_genre']) ? sanitize_text_field($_GET['pgs_genre']) : '';
$query_args['s'] = $pgs_artist;
return $query_args;
}
add_filter('post_grid_query_args','post_grid_query_custom_search', 90, 2);

Welcome to our forum.
Could you please share your link where you trying? i can see the code has many errors, probably not used correctly, if possible please send me a temporary admin access to your site, i will check the issue.
Regards
Before I send you that info, is there a way to just show the filter above the post grid? I found your addon for plugin 'post-grid-search-master' but how do I add the filters for custom taxonomies instead of just category and tag?