I appreciate your efforts in finding solutions to improve our lives!
I was massively testing the component and the query properties.
In the component instance configuration, when I go to configure a specific query property for this instance, when I switch to PHP query, the query doesn’t work well.
For example, it no longer filters by taxonomies.
Before, I used this same query in the blocks and it worked well, filtering perfectly.
Here is an image and the query I am using.
// Nome da option que armazena os campos da Options Page
$options_page = get_option('pagina-inicial'); // Substitua 'jet_engine_options_page' pelo nome correto da Options Page
// Se a Options Page estiver armazenada em um array, pegamos o valor do campo específico
$numero_de_itens_destaques = isset($options_page['numero_de_itens_destaques']) ? $options_page['numero_de_itens_destaques'] : 8; // Define 10 como valor padrão se não encontrado
return [
'post_type' => 'imovel', // O CPT "imovel"
'posts_per_page' => $numero_de_itens_destaques, // Usa o valor obtido da Options Page ou o valor padrão
'meta_query' => [
'relation' => 'AND',
[
'key' => 'statusi', // Filtro pelo meta field "statusi" como true
'value' => 'true',
'compare' => '=',
],
[
'key' => 'destaquei', // Filtro pelo meta field "destaquei" como true
'value' => 'true',
'compare' => '=',
],
[
'key' => '_thumbnail_id', // Certificar que o post tem uma imagem destacada
'compare' => 'EXISTS',
],
],
'tax_query' => [
[
'taxonomy' => 'finalidade', // Filtra pela taxonomia "finalidade"
'field' => 'slug',
'terms' => 'venda', // Apenas para posts com finalidade "venda"
],
],
];