Random Post in Related Post

function custom_pre_get_posts($wp_query) {
$wp_query->set(‘orderby’, ‘rand’);
$wp_query->set(‘order’, ‘ASC’);
}

add_action(‘pre_get_posts’, ‘custom_pre_get_posts’);

Related Articles

MemberPress Check active

add_action ( ‘template_redirect’, ‘redirect_custom_nonactive’ );function redirect_custom_nonactive(){if ( current_user_can(‘mepr-active’) && is_front_page() ) {echo ‘Welcome, active member user!’;}else { echo ‘Welcome, non-active registered user!’;} }