Display random page
The first condition you list is easy. You just need the post_parent__in arguments. $args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, ‘orderby’ => ‘rand’, ‘post_parent__in’ => array(2,169), // replace with your IDs ); $rand = new WP_Query($args); if ($rand->have_posts()) { while ($rand->have_posts()) { $rand->the_post(); the_title(); echo ‘<br>’; } } For the second condition, I … Read more