Thank you and sorry for unclear request 
Basically I have to print in the home page all the children pages of a page called “works” (it’s a portfolio of a photographer I’ve done several years ago in WP and now I have to move it to Kirby). Those pages hast to be filtered by categories (and for this task I’m using a controller), paginated in order to load them with an infinite scroll but also appear in random order.
Everything works fine except from the shuffle that of course doesn’t work properly with pagination. I installed the plugin shuffleSeed from Bruno but it doesn’t shuffle the works… what’s wrong with me? I have to say I’m a designer so not an advanced programer 
This is the controller I use, where I load the pages, filter, shuffle and paginate them.
<?php
return function($kirby, $page) {
$works = page('works')->children()->listed()->shuffleSeed();
// add the filter filter
if($filter = Str::split(urldecode(param('filter')))) {
$works = $works->filterBy('filters', 'in', $filter, ',');
}
$works = $works->paginate(2);
$pagination = $works->pagination();
$filters = $works->pluck('filters', ',', true);
return compact('works', 'filters', 'filter', 'pagination');
};
Here is where I print them in the home page
<?php foreach($works as $work): ?>
<?= snippet('work', ['page' => $work]) ?>
<?php endforeach ?>
<?php if ($works->pagination()->hasNextPage()): ?>
<a class="next loading" data-infinte-scroll="<?= $works->pagination()->nextPageURL() ?>" href="<?= $works->pagination()->nextPageURL() ?>">
( Waiting )
</a>
<?php endif ?>
And this is the plugin I found in the forum
<?php
Kirby::plugin('bruno/shuffleSeed', [
'pagesMethods' => [
'shuffleSeed' => function($seed = null) {
if(is_null($seed)) {
$seed = s::get('seed');
if(is_null($seed)) {
$seed = time();
s::set('seed', $seed);
}
}
mt_srand($seed);
$keys = array_keys($this->data);
$size = count($keys);
$order = array_map(function($val) {return mt_rand(); }, range(1, $size));
array_multisort($order, $keys);
$collection = clone $this;
$collection->data = [];
foreach ($keys as $key) {
$collection->data[$key] = $this->data[$key];
}
return $collection;
}
]
]);
?>