Joy
(@joyously)
You could use the plugin you like for posts, and make a copy of it. Then change the code where it is querying the database. It should be just a change of post type, from “post” to “page”.
You could probably still use one of those plugins and alter the query they use to get pages instead of posts. Assuming they use the WP_Query class, this can be done by hooking the “pre_get_posts” action and setting the “post_type” query var to be “page”.
The trick is to only modify the widget’s query and not any others. It’s likely it’s the only query where the posts_per_page value is 1 and the orderby query var is “rand”. By checking for characteristic query vars before changing the post_type query var, you avoid altering the wrong query.
If it wasn’t already obvious, this approach involves custom coding. If you’re unable to do so, nor are able to hire someone to do so, maybe someone else will have a suggestion for an existing plugin, but it sounds like you’ve already done a fair bit of searching on your own without success.
Thanks for your help and answers !
I finally fond this plugin which do the job with a parameter !
https://fr.wordpress.org/plugins/random-post-on-refresh/
[random_post_on_refresh post_type=”page” show=”title, excerpt” ]
bye