/ Published in: HTML
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
STEP ONE: If you want to make your own private page template, using your own theme, simply open your existing "page.php" file in a text editor, then save a copy of it with the name "template-private-page.php". Then, at the very top of the new template page, add the following code snip: <?php /* Template Name: Private Page */ ?> <?php do_action( 'walled_page' ) ?> STEP TWO: Open up your "functions.php" file and at the very bottom, add the following code (be sure you put it just above the "?>" closing bracket: /* This makes a function to be used on private page template */ function sh_walled_page() { global $bp; if (bp_is_register_page() || bp_is_activation_page()) return; if(!is_user_logged_in()) { bp_core_redirect( $bp->root_domain .'/unavailable'); } } add_action( 'walled_page', 'sh_walled_page' );