Custom Query in Layout Builder
This is driving me nuts and I’m sure it’s something simple. I am in the layout builder adding a Post Grid to a page. I want to use a custom query to display only specific posts by ID and in a specific order- i.e. I want to get posts 2, 4, and 6, but display 6, then 2, then 4.
From the WP_Query parameters page, I should be able to do something like:
orderby=post__in&’post__in’=array(6, 2, 4)
I can’t get it to work. It displays all the posts (1-6) and in order by newest first. Been messing with different versions of this for an hour trying to get it to show correctly. Any tips on what I can type in the Custom Query String field in the Layout Builder under the Post Grid to get this to work?
If I type a super simple query like p=2, it works just fine. I also see that using ‘post__in’ with orderby is only supported in 3.5, which I am running. It is a new site I uploaded today.
- The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.