Setting item ordering for archive layouts

The new archive layouts are really nice! I’m just wondering if there is a way in the layouts designer to set the item ordering? Or do we have to do it in our functions.php file still?

I am making an archive layout for a custom post type which I would like to be in order of title rather than date. I know how to do it in my functions file, but just wondering if I’m missing an easier way.

Also, since I’m asking, would there be a way to add an “order by” button to the design also - somewhere near the pagination section for example.

Thanks :slight_smile:

Hi Steve

Are you expecting the Layouts to be ordered by title while showing in the Layout Builder? If that is not the case and you are trying to point out something else, please provide any screenshot or any video that helps us to understand what you are expecting.

Thanks

No. I mean that on my archive page, the posts are ordered by title.
Currently using something like this in functions file, but would be nice to be able to change it from within my layout design:

$query->set( 'orderby', 'title' );

Howdy, @spedney! Thanks for writing in…as of right now, the best way to change the ordering of an archive layout in the way you’re trying to achieve would be using something like the custom code you mentioned above. There is no way to natively alter the ordering of the archive layout overall in the builder at this time, but I’ve made a note of this in our issue tracker as something to look into for a future release, but I cannot give a definitive timeline on if / when that might be in, so for now I would continue to make these adjustments via your child theme as mentioned above.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.