I am creating separate templates and I am trying to have post query based on the category but for some reason it seems not to be working. If you could give me a hand that would be great. I am just getting every single post no matter what category.
Code:
$args = array( 'numberposts' => 100000000000, 'offset'=> 1, 'category' => 'Uncategorized' );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
<!--<h2><a href="<?php //the_permalink(); ?>"><?php //the_title(); ?></a></h2>-->
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endforeach; ?>
Read get_post you will see many note over there one of which says
Note: The category parameter needs to be the ID of the category, and not the category name.
So give category ID for your category “Uncategorized”.