I load in subpage post with one category now i try filter this post by him subcategory and get link to page some like mypage.com/subpage/?slug=fish after click button and see only fish post.
I should use $_GET?
Anyone can help?
There is my code who load all my post from category animals
<?php
$args = array(
'cat' => 50,
'posts_per_page' => '999',
'order' => 'ASC',
'orderby' => 'menu_order',
);
$the_query = new WP_Query($args);
// The Loop
if ($the_query->have_posts()) {
?>
<?php
while ($the_query->have_posts()) {
$the_query->the_post();
get_template_part( 'templates/content/content', 'animals' );
}
/* Restore original Post Data */
wp_reset_postdata();
} else {
// no posts found
echo '';
}
?>