<?php
$css_especifico = "index";
require_once('header.php');
?>
<main class="home-main">
<div class="container">
<?php
$taxQuery = array(
array(
'taxonomy' => 'localizacao',
'field' => 'slug',
'terms' => 'rio-de-janeiro'
)
);
$args = array(
'post_type' => 'imovel',
'tax_query' => $taxQuery
);
?>
<ul class="imoveis-listagem">
<?php
$args = array('post_type' => 'imovel');
$loop = new WP_Query($args);
if($loop->have_posts()){
while($loop->have_posts()){
$loop->the_post();
?>
<li class="imoveis-listagem-item">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
<h2><?php the_title(); ?></h2>
<div><?php the_content(); ?></div>
</a>
</li>
<?php
}
}
?>
</ul>
</div>
</main>
<?php get_footer(); ?>
Tenho esse código, porém ele não está filtrando por categoria e sim ta pegando todos os registros. No admin eu ja setei como a cidade que deveria estar. Há algum problema no código?