• I’m looking for advice on how to set up a “members only” page only accessable by members of my organization. Can anyone help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Can be done by createing member template

    Create file name member.php

    <?php
    /*
    Template Name: Members
    */
    ?>
    <?php if ( $user_ID ) : // if logged in ?>
    
    YOUR TEMPLATE CODE HERE you can use single.php code if you want with sidebars or a one column no sidebars code your choice.
    
    <?php else : // if not logged in go to login page 
    
    	$url = 'register';
    	header("Location:$url"); 
    
    endif; // end if logged in
    ?>

    You need to use register url here $url = ‘register’; I have register because i am using buddypress.
    Once you saved the file you will have member template in Page Attribute select that on the page you want loged in memebrs to see.

    There’s a tutorial for creating members only content here. It also features a re-direct after login, so users never see the dashboard if yo don’t want them to.

    Members only content in WordPress

    I hope this helps!

    The content can also be made Private or Password Protected using Visibility in the Publish module.

    Michael

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Members Only Pages’ is closed to new replies.