Building With

GenerateBlocks

Useful tips for building advanced blocks.

Query Loop – Select Specific Category

If you are looking to create a page showing the latest blog posts of a specific category, this can be achieved with Query Loop.

In my case, I’m looking to create a Home Page with 6 posts from a specific category.

1

Click on the ‘+‘ icon and add the Query Loop block from GenerateBlocks.

Add Query Loop

2

Query Loop will give you multiple layout options. Select the one that best suits your blog.

Query-Loop-Layout-Options

3

Leave the Select post type as Posts and you can modify the Posts per page to a number of your preference.

Query Loop Add Parameter

4

Select Taxonomies from the scroll-down menu.

Query-Loop-Taxonomies-v1

5

Then select Categories for Taxonomies and from the drop down menu select the category you would like to feature.

In my case, I decided to show the latest posts from the Graphics category.

If you have sub-categories and would like to feature posts within those categories, then enable Include child terms by toggling the button.

Query-Loop-Categories-Terms-v1

Final Results

Click on Save draft or Publish, and you are done!

Your page should now feature the latest posts from the specific category of your choice.

Comments (2)

Leave a comment