Hi Kees,
Yes, it should be possible to add a GB Query Loop Block that’s ordered randomly. Since your homepage is a static page, you can add it directly to the page. You’ll need a code like this:
add_filter( 'generateblocks_query_loop_args', function( $query_args, $attributes ) {
if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'my-class-name' ) !== false ) {
$query_args['orderby'] = 'rand';
}
return $query_args;
}
return $query_args;
}, 10, 2 );
Add my-class-name
to the class list of the Grid Block in the Query Loop Block.
2. It should also be possible but this is more complicated. You would need a plugin that records post views, and then use the post meta for the views generated by that plugin in a custom code.
Lastly, for GenerateBlocks related inquiries, please reach out to us here: https://community.generateblocks.com/