Next, I'm a beginner with wordpress and php, so I'm having problems with my first theme built from scratch, I have a div that will serve as a selector on the site, through it I want to filter the content that will appear in the loop. p>
<div class="select">
<div class="select-cima" id="recentes">
<span>Mais Recentes</span>
<div class="barra-recentes">
<div class="seta"><img src="" alt="seta-cima"></div>
</div>
</div>
<div class="select-baixo populares sumir" id="populares">
<span>Mais Populares</span>
</div>
</div>
When clicking on these IDs the filters must be different, the recent filter works naturally so I call the posts of my custom post_type (through WP_Query changing the post_type), but I am not able to filter the popular ones and I am also not getting make sure you have this change in the filters I've already put in the code. Here is the idea that I tried to make it work, but besides not filtering the page, did reload, ideally would not do the reload.
Attempt:
<a href="?meta_key=wpb_post_views_count&orderby=meta_value_num&order=DESC"><span>Mais Populares</span></a>
Thanks in advance for the help.