basically what you want to do is get the id from $_GET['id']
then you can use the WP_Query
<?php
wp_reset_postdata();
$args = array(
'category' => $_GET['id'],
'order' => 'DESC',
);
$query = new WP_Query($args);
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
//do your stuff here......................
endwhile; endif;
?>
here $_GET['id']
will get all the posts from category
If $_GET['id']
is a post ID and you have to retrive all the posts using that specific posts category then simply get the category id from that post by using
$category_detail=get_the_category( $_GET['id'] );
and then you can use the query like:
$args = array(
'category' => $category_detail,
'order' => 'DESC',
);
$query = new WP_Query($args);
hope this helps