Hide my Members from users not logged in

  • Chuck
    Chuck
    Newbie 4 points
    August 18, 2015 at 10:54 am

    Is there a way to hide my “Members” page so people just can’t come to the site and see all my members and their contact info? I just want people that logged in to be able to see it.

  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    August 18, 2015 at 10:59 am

    One way is to hide it from the menu for the not-loggeg is user. By this, only the link will be hidden in th menu, but they can access your page, if they have the link.

    Other way is to, they can visit the page, but it would say them to login to view the members.

  • Chuck
    Chuck
    Newbie 4 points
    August 18, 2015 at 11:03 am

    but how do I make it say Log in to view members?

  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    August 18, 2015 at 11:06 am

    For that, you need to add a php syntax in tpl-member.php

    Upload that file as zip here, I would modify it for you.

  • Chuck
    Chuck
    Newbie 4 points
    August 18, 2015 at 11:16 am

    Here it is

    Attachments:
    You must be logged in to view attached files.
  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    August 18, 2015 at 11:41 am

    try with this.

    Attachments:
    You must be logged in to view attached files.
    This reply was awarded the best answer by the topic poster.
  • M
    M
    Senior Member 278 points
    August 18, 2015 at 11:48 am

    If you simple wanted to redirect NOT Logged in users to the login/register page

    Place this code to : Design Setup -> Custom Meta Data -> Footer Styles

    Change the url yourPage.com and or the word members if you call your members page something different
    [code title=””]
    <script>
    jQuery(function() {
    if ( document.location.href.indexOf(‘/members’) > -1 && !jQuery(‘body’).hasClass(‘logged-in’)) {
    jQuery(location).attr(‘href’,’https://yourPage.com/login&#8217;);
    }
    });
    </script>
    [/code]
    Using the above will avoid you having to edit the tpl file after each premiumpress update.

  • Chuck
    Chuck
    Newbie 4 points
    August 18, 2015 at 12:02 pm

    Wow, thanks guys for the quick response.

Viewing 8 posts - 1 through 8 (of 8 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes