Forums

[Plugin: WP-Members] Getting Login to appear on homepage (not sidebar) (2 posts)

  1. databell96
    Member
    Posted 1 year ago #

    I'm new to the WP-Members plugin but what I need it for is to make it where you have to login to get anywhere in the site. Not just some posts. I'd like it where the homepage is nothing more than my header, footer, no sidebar and a big login area. Similar to what you see when you login to WP-admin. Does WP-Members do this and if so how? If not, can someone point me in the right direction so I can set it up?

  2. Chad Butler
    Member
    Posted 1 year ago #

    WP-Members is designed to block content on content pages, but not summary pages. The home page is generally set up to be a summary page, but it doesn't have to be. You could create a custom template for the home page that contains what you described. Something like this:

    <?php get_header(); ?>
    
    any additional format html here, depending on your theme
    
    login form
    
    any additional closing html here, depending on your theme
    
    <?php get_footer(); ?>

    For additional information, review Creating a Static Front Page.

    You would need to have a php conditional statement to determine what to do if the user is logged in. You can review how the sidebar login form handles the process in the function wpmem_inc_sidebar in wp-members-sidebar.php or wpmem_login_form in wp-members-dialogs.php. You might want to review wpmem_login in wp-members-core.php as well.

    WP-Members replaces full content with a login form and registration process for a non-logged-in user. This will prevent a user from directly accessing your content, but they will receive the login form on that page. If you intend to force them to the homepage, you would need to make some modifications to the plugin itself, which I do not recommend.

Topic Closed

This topic has been closed to new replies.

About this Topic