Rotating featured posts

I am replicating featured posts from my database using this guide:

Any ideas on how can set them up to:
(a) automatically rotate
(b) load randomly

Similar to the blog elements in Wix old blog…

Am not familiar with Wix Blog, so I do not know what you mean by a).
About b), I just did some random sorting myself. The idea behind is it that you create an array of fields from your collection (string/num/date only), pick one at random and use the field you picked as a sorting argument for your next query on the blog entries itself.

Let´s say the blog collection holds these fields; Title, Bodytext, date, contributor.
To get those field names into an array, you can either hard code the array or read it from a new collection. In the last case, you setup only one field (title) and enter 4 rows, each one holding the field name.

In code, you query this collection without filter or sorting, you want it all in any order. Then use the JS random (lookup math.floor and math.random), you multiply the value between 0 and 1 with the totalcount of the collection (here, 4), so you get a random number between 0 and 3 (arrays are 0-based).
You pick the title-value from the array with this index, which would return 1 of the 4 field names.

Now you make a query on the real blog entries collection and on the .ascending or descending you use that field name to sort on.
This is about as random that I could come up with.