Randomize pages on WordPress

I'm trying to make the featured module on my website (www.twohitgames.net) under the news (in grey and a photo on the left) always launch a random page every time you enter. I've found the function but I can't get it to be random. I've found the slug id of the category, in my case 53, and developed it so that it takes the category and randomizes it. Does anyone have any idea what could be wrong with the code? Thank you for your help :) function ghostpool_custom_featured_query( $gp_args, $post_id, $page_id ) { return $gp_args = array( 'post_status' => 'publish', 'post_type' => 'page', 'tax_query' => [ 'taxonomy' => 'gp_hubs', 'terms' => 53, ], 'posts_per_page' => 1, 'paged' => 1, 'no_found_rows' => true, 'ignore_sticky_posts' => 1, 'orderby'=> 'rand', // Orders randomly ); I tried the code attached.

Comment (0)

You’ll be in good company