Excellent, works like a charm!
Many thanks for this and the previous one for randomizing them that I also found here.
I use those for creating a design portfolio, simply by using GP’s masonry layout for posts archives. No need of another plugin. Featured images are design screenshots in full height and details & links to the websites are in the excerpts.
Hi again about same topic: I would like to use the same snippet above that works fine for “all posts” but by adding a condition to apply only to a given post category, ex. all posts from category “abcd”.