 Hi, and welcome to Learn Wordpress. When you hear the term query loop, is your first thought query what? If so, you're not alone. This powerful block can be used to display posts based on specified parameters. Query means to ask. So the block will allow you to ask the database to show you all the posts about a specific topic. You can customize this as you would like to see the most recent posts in a specific order, to change how many posts are shown on your site, or to exclude a certain category of posts. For example, you can ask to see all the posts written about gluten-free recipes, or posts about reviews of computer games. The query loop block will be delighted to answer your question or query and show you a preview of all those posts. Each query loop block is made up of various blocks, like the post featured block, the categories block, the post title block, the post author block, the post excerpt block, et cetera. While you won't be able to edit the content of these nested blocks, you can customize the appearance and layout, including adding or removing additional blocks as you'd like. Let's look at a few example websites to see how they've used query loops. In our first example, a query loop has been used to highlight the latest stories recognizing women's creativity, leadership, courage, and innovation. And below that, a query loop has been used to display blog posts. In the second example, query loops have been used to display different types of recipes. First up, we have breakfast recipes, and if we scroll down, amazing appetizers. And in our last example, a query loop has been used to create a news page. Let's first look at how to modify query loop block and use patterns. So let's make our way to appearance and click on editor. This will take us into our site editor, and currently we are on our homepage template that displays all our blog posts. Let's open up our list view and make our way down to the query loop block. On our right, we will see all our blog posts are being displayed in grid view. But we can change that to list view in one click. When we open up our query loop block in the list view, we will notice that at the moment we can see the post featured image, the post title, the post excerpt, and the post date. But of course, we can alter what we want to have displayed. So let's add a post author block so that we can see who wrote each post. And if you change something in one post, it will appear everywhere else. And of course, don't forget to click save. But what if we want to use a completely different pattern and layout? Well, we can click on replace in our block toolbar and browse through the various patterns that come with your theme in carousel view or in grid view. At the moment I'm in carousel view and when you click on the arrows or movers, you can browse through the various patterns that come with your theme. And when you select a pattern, you can of course customize it as you please. I will go ahead and remove the post excerpt block and then change the size of the post title to large and insert a post featured image block above the post title block. And then I will change the height of the post featured image block to 282 pixels to ensure that all the images display the same. And lastly, I will change the position of the post date block by using the arrows and pushing it below the post featured image. The other option is to remove the query loop to add a new one. And when you do that, you have two options. To choose a pattern as we just saw or to start blank. And when you start blank, there are a few variations to choose from. And once you have made your selection, you can go ahead and customize it accordingly. Next up, we are going to have a look at taxonomies or filters and how to use the sidebar settings. I've created a lifestyle page and only want to see posts related to this topic. So I will select the query loop block and then open up my sidebar settings. And the first thing we have to do is deselect Inherit Query from template as I want to customize the settings of the query loop. And when you scroll down, you now have an option to filter your posts by using taxonomies such as categories and tags, authors and even keywords. I'm going to select taxonomies as I've created a category called lifestyle and only want to see posts with this category displayed. And when I add the lifestyle category, all posts that don't have this category will be excluded. Secondly, I've created a nutrition page and I will use taxonomies to only display posts with the nutrition tag. So I will select the query loop block, click on filters and select taxonomies and then search for the nutrition tag. And once selected, all my posts will be related to healthy eating. You also have the option to display posts from a specific author. So once I select the query loop block again, I will go to my sidebar settings, click on filters, select authors and select the person whose posts I would like to display. Now we will only see posts written by Roger Lister. You can of course also choose a keyword and only display posts which contain that word or words in the text. Lastly, let's have a close look at our sidebar settings. As mentioned, I've deselected Inherit query from the template. If you toggle it on, certain customization options will be hidden and if you toggle it off, more customization options will appear. The next option is post type. At the moment, we are displaying blog posts but you can even display pages or custom post types. The next setting we are going to look at is columns. And here you can change how many columns you would like to have displayed. Below that, you have the option to order your posts from newest to oldest, oldest to newest or alphabetically. Next, let's talk about sticky posts. A sticky post is a post that sticks to the top of your blog page and the option in your sidebar settings will allow you to include sticky posts, exclude them or to only show sticky posts. Then of course, we have already discussed using filters. And lastly, you also have the option to change the color of the text, background and links of your query loop block. All the base taking advantage of query loops and visit Learn WordPress for more tutorials and training material.