dimanche 30 juillet 2017

Random posts but with some factors to effect the order in php

I will be happy to get some code snippets, but the question is more of a "direction / ideas" question so fill free to write ideas without the practical specific way to construct them:

What i need is:

Take a random (completely random) posts array that comes from Wordpress's wp_query function and add some tweaks to it.

The posts are actually freelancers from different professions and i want some values to effect there order. so for example: a freelancer with more experience will be "pulled" a little bit higher in the list, a freelancer that attached more media to his "ticket" will be "pulled" a little bit higher in the list and so on...

But i want to be able to still maintain the "randomness" of the list. so generally pull some posts higher by different factors but still make it random so no page refresh will have the same order.

So it will be as if there is some "low gravity posts" inside the general "chaos" :)




Aucun commentaire:

Enregistrer un commentaire