Query Loop Question

[ad_1]

I have what seems like a very simple objective that I can’t figure out. I want o show 1) my latest blog post at the top of my blog’s home page followed by 2) the next \~9 blog posts.

I want both #1 and #2 to automatically update when new posts are created.

That part seems easy enough, as I can use two different Query Loops and offset the second one to skip the latest entry.

However, I want to customize the layout and post details that are shown in each of the Query Loops. I want it to show the posts in list view, and for each post show the post’s Title, Date, Categories, Tags, Excerpt, and Author and customize the order and layout of those items. For the life of me, I can’t figure out how to change/customize the “Post Template” within the Query Loop to allow me to customize those items and layout. What am I missing?

If this isn’t possible using Query Loop, is there an alternative method that would achieve this?

[ad_2]
2 Comments
  1. I assume you’re using Gutenberg blocks or something for this? If so, sorry I’m not much help. If you were coding this yourself it’s relatively trivial to style it or change the layout however you want for the first and next 9 items.

  2. Are you able to code? An if statement within the a loop is the way to go. For instance you setup a variable with the number one. Then at the end of the while loop you increment the variable/number..
    The if statement checks if the number is 1 and outputs one set of html and then after that it outputs all others as the second set of html.

    You can do all of this inside a single loop.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer