Archived topic
Using Query Posts to Show Featured Posts Versus Latest Posts
9 replies · Started by Myles on December 20, 2022
Hi, I've read the overview on how Query Posts work, and understand the basic operation.
However, how do I tell a Query Post block
- what type
of posts to populate within the block?
For example, I'm using a GP theme that have a Query Posts block on the home page featured just Featured Articles, then another Query Posts block beneath that showing Latest Articles.
I tried looking at each block's setting to determine what the difference is and how one is pulling featured articles while another is pulling recent posts, but. I could not see a difference.
Can you please advise? Thanks!
Hi Myles,
Can you link us to your homepage?
I'm not seeing the site link.
That's weird...Let's try again :)
The 1st query loop is not presenting the featured image, it's just the latest 3 posts.
The 2nd query loop is also presenting the latest posts, but offsetting the latest 3 posts which are already presented in the 1st query loop block.
Thanks, Ying! That makes sense.
That brings up the question, how can I use Query Post blocks to show, perhaps only manually selected posts for a blog?
And secondly, how can I use Query Post blocks to show only posts that belong to a specific primary category?
Hi Myles,
To choose which posts to show in a GB Query Loop Block, you can set parameters in the Block settings. Reference: https://docs.generateblocks.com/article/query-loop-overview/#query-parameters
For instance, if you have a Featured Posts section, you can tag posts as featured. Then, add the parameter to include only posts from Taxonomies - Tags - featured. Example: https://share.getcloudapp.com/jkuOe0xd
You can also choose specific posts, and posts from specific categories through the Parameters option.
For specific posts, choose the parameter "Include posts".
For posts of a specific category, choose Taxonomies - Categories.
Awesome, thanks!
You're welcome, Myles!