add_action( 'pre_get_posts', function( $query ) {
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
$query->set( 'post_type', 'post');
}
});
foreach ( $general_att_array['options'] as $general_att_value ) {
$products .= "\n\t\t\t<param name=\"". $tax_att->labels->singular_name ."\">";
$att_term = get_term($general_att_value);
$products .="\n\t\t\t" . $att_term->name . "</param>";
}
$attr = [];
foreach ( $general_att_array[ 'options' ] as $general_att_value ) {
$att_term = get_term( $general_att_value );
$attr[] = $att_term->name;
}
$products .= "\n\t\t\t" . sprintf('<param name="%s">%s</param>',$tax_att->labels->singular_name,implode( ',', $attr ));