Set Coming Soon Page

PHOTO EMBED

Thu May 26 2022 20:21:06 GMT+0000 (UTC)

Saved by @techiemamma #wordpress #php

// add a custom Coming Soon page

add_action( 'template_redirect', 'my_custom_coming_soon' );

function my_custom_coming_soon() {

    if( !is_user_logged_in() && !is_page( 'coming-soon' ) ){

        wp_redirect( site_url( 'coming-soon' ) );

        exit();

    }

}


// To disable the coming soon page, just comment out this line by adding // at the start
//add_action( 'template_redirect', 'my_custom_coming_soon' );
content_copyCOPY