I Have 2 similar websites both created on oceanwp Maria theme .
I Wanted To Randomized Posts On My Homepage So I Added This code ⏬ In Function.php of both websites
add_action(‘pre_get_posts’,’alter_query’);
function alter_query($query){ if ($query->is_main_query() && is_home()) $query->set(‘orderby’, ‘rand’); //Set the order to random }
But After Recent Updates On OceanWp Theme This code is not working on my updated theme website & is working fine on website which has not been updated yet
edit :- After Updating theme I added the code again in Function.php & now its working
<solved>
The page I need help with: [log in to see the link]