On several pages, including a category archive page (and in the category feed), WordPress by default shows posts in that category and its child or sub-categories.
What if you want to change which posts are included? Use the pre_get_posts
filter to modify the query sent to the database and customise what posts are displayed. Here are some functions to add to your theme’s functions.php
file.
Continue reading Displaying Other Posts in the Category Hierarchy in WordPress