• Hey people!

    I just got a very simple plugin that performs a auth_redirect() if the visitor is not logged in the blog, however it would be great if I could, instead of the auth redirect, just print in the screen some very simple “coming soon” html code.

    function private_wp() {
      if (!is_user_logged_in()) { ?>
    
        // auth_redirect commented, not being used
        // auth_redirect();
    
      	// I need to just print a simple HTML as below
    	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    	"https://www.w3.org/TR/html4/strict.dtd">
    	<html lang="en">
    	<head><title>Coming soon!</title></head>
    	<body>
    		Coming soon!
    	</body>
    	</html>
    
      <? }
    }
    
    add_action('wp_head', 'private_wp');

    I see the plugin is working, however it just prints the desired html code on top and keep loading the website normally after it. What argument for the function add_action() could just output my coming soon page and stop the rest of the page to load?

    Thanks so much for your attention.

    Regards,
    C.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Making private blog: How to print simple HTML instead of auth_redirect()?’ is closed to new replies.