latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Members page meu hidden from guest users?

Home Forums Community Forum Members page meu hidden from guest users?

Tagged: ,

This topic contains 19 replies, has 3 voices. Last updated by  Mary Sullivan 3 years, 11 months ago.

Topic Author Topic
Posted: Tuesday Jan 8th, 2013 at 12:55 pm #36591
James P
Username: TheTwister

Hi there,

Does your FREE member system suite my needs?

I need a members login system so when a member logs in another menu will appear and stay. That menu will have all of the members pages. When they login it goes straight to the members home page. I want the members menu hidden for non members.

This is a site where members already have an account created for them. It is just for them to see the extra pages (hidden). I have to create all the accounts for each member. No no register page needed.

The member menu will have around 6 pages.

Can this be done?

  • This topic was modified 3 years, 12 months ago by  James P.
  • This topic was modified 3 years, 12 months ago by  James P.

List Of Topic Replies

Viewing 19 replies - 1 through 19 (of 19 total)
Author Replies
Author Replies
Posted: Tuesday Jan 8th, 2013 at 2:53 pm #36606

I’m trying to figure out how to do this as well. Is it a function of our theme? I don’t want everyone to see all the pages if they aren’t allowed to see them, it will just be annoying to them.

Posted: Tuesday Jan 8th, 2013 at 6:13 pm #36635
James P
Username: TheTwister

What do you mean ” a function of our theme”?

Yes that’s it I don’t want guests to see all the members pages.

Posted: Tuesday Jan 8th, 2013 at 6:42 pm #36639

Sorry, I mean does it depend on what theme we use. I use iThemes for some sites and they allow you to create different template pages, and you can drop a different menu into a template that would include the protected pages. So the page you create for your membership landing page would use that different template as would any private pages. So I’d call the new template = membership and any private pages would see that menu.

However, when I’m using a different theme that may say it only supports one menu, I have no idea how to add the different menu that includes the additional pages. And if you add them to your regular menu, you will annoy your viewers if they keep clicking on pages that they aren’t allowed to view.

That’s what I meant. It would be ideal if those pages didn’t show up in the menu at all unless the person was signed in. that’s what I would love to see. So if a moderator can tell us if that is possible somehow it would help both James and I!

Posted: Wednesday Jan 9th, 2013 at 5:45 pm #36808
James P
Username: TheTwister

I wouldn’t think it would depend on what theme.

Posted: Saturday Jan 12th, 2013 at 1:54 pm #37149
James P
Username: TheTwister

Mary have you found a way?? If not do you know if there is a way to make it so widgets can be hidden? Then at least it will be hidden for non members.

Posted: Sunday Jan 13th, 2013 at 10:08 am #37244

Yes, a friend helped me with adding another menu with some php. I have to look at it today, and I’ll let you know the code to put in.

When you update your WordPress site, it won’t wipe this out either.

Posted: Sunday Jan 13th, 2013 at 12:13 pm #37266
James P
Username: TheTwister

Thank you so much :). I hope it will do the trick :)

Posted: Sunday Jan 13th, 2013 at 9:26 pm #37319

Hi James,

Okay, here it goes.

1. Download a plugin called TagPages. This allows you to tag, well, pages.
2. In your Function.php file of your theme, add this code

register_nav_menus(array('primary-menu' => __('Primary Navigation', THEME_NS)));
register_nav_menus(array('secondary-menu' => __( 'Secondary Navigation', THEME_NS)));

This is so you can add a second menu to your site. It goes after the section (around line 93) that has add_theme_support and before function theme_header_image_script() {
3. In your header.php file you should have some code that is:

original code was --
 
   echo theme_get_menu(array(
             'source' => theme_get_option('theme_menu_source'),
             'depth' => theme_get_option('theme_menu_depth'),
             'menu' => 'primary-menu',
             'class' => 'hmenu'
         )
     );

So put in this code instead (overwriting the above code)

if (has_tag( 'private' ))  {
     echo theme_get_menu(array(
             'source' => theme_get_option('theme_menu_source'),
             'depth' => theme_get_option('theme_menu_depth'),
             'menu' => 'secondary-menu',
             'class' => 'hmenu'
         )
     );
 
} else {
 
 
     echo theme_get_menu(array(
             'source' => theme_get_option('theme_menu_source'),
             'depth' => theme_get_option('theme_menu_depth'),
             'menu' => 'primary-menu',
             'class' => 'hmenu'
         )
     );
}

4. Then go to your menus and add your new menu (I put all the usual items from the main menu in the second menu and added the private pages as well). You’ll see that you now have two levels of menus on Navigations section under Theme Locations. Choose your second menu (I called mine PrivateMenu) as your Secondary Navigation.
5. Under Pages, you will have another submenu called Tags, Create one called Private and then tag any pages you want to be private (and more importantly, included in the secondary menu) with this tag.
6. Finally, what I did is had my login page under “about us” go directly to mydomain.com/wp-login.php. Then the first page they come to is the login-welcome page. I now have the secondary menu showing. (I’ve created a user that has level 1 privileges).

This is all with the free version. I hope this helps. Sorry for the delay, but I had to work through how it was done myself!

Posted: Sunday Jan 13th, 2013 at 10:28 pm #37326

Hi all
I find the problem different than as suggested that being a theme issue.
I have a membership site that contains just the use of s2member level 1 for all members and of cause there is the non-member view and also the admin view of the site.

Now I initially built the site using the Thesis theme 1.85 and wordpress 3.4.2 and it all worked perfectly. That is when a non-member visited the site they could only see the menu links to pages and posts that had no s2member level (a normal visitors view).
When a member was login he could see the menu links to all pages and posts that had s2member level 1 and what the normal visitor would see.
Because the site was designed for a client I had a menu link called admin which contained a few sub-menus as well which I designated these pages at s2member level 2, when logged in as admin he could can see all the menu links but the members and non-members could not see the admin menu links.

This all happened without any additional coding etc.

As soon as I updated to wordpress 3.5 the menu links that remained hidden according to access level were now appearing to anyone who visited the site only restricted by s2member’s ‘Membership Option Page’ redirect.

I have not found a solution yet as I have only found this post by using this forum looking for reasons or others who have had a similar problem.

So from my experience it seems to be wordpress newest version of 3.5 that has somehow changed the menu structure and how it works with s2member restrictions.

I also have tried it with the newer version of Thesis 2 and am having the same problem so the most common denominator given my experience is going from WP 3.4.2 to WP 3.5

Posted: Monday Jan 14th, 2013 at 12:49 am #37328

Just a follow up to my post above, I did find the problem that prevents nav menu links to be shown or not shown depending on your access levels.
In the s2member plugins setting in the ‘Restriction Options’ page look for the ‘Alternative View Protection’ tab and make sure the “Filter ALL WordPress queries” box is ticked.

This will give you the ability depending on your access levels to hide post, pages and their links based on membership levels.

For example: if you mark a page as a level 1 access level and another at level 2 and both pages are on the nav menu then if level 1 is login they will not see the nav menu link to the page with level 2 access.

It is a much simpler way than all the above approaches and avoids hard coding and creating 2 separate wp menus as has been suggested in other solutions.

Posted: Monday Jan 14th, 2013 at 10:31 am #37381

Thanks Darryl,

I’ll try that option on another site I’m working on.

Posted: Monday Jan 14th, 2013 at 11:04 am #37405
James P
Username: TheTwister

Hi Mary,

Thank you so much for this :).

I cant find this code in my header. Where do I need add the new code?

original code was --
 
   echo theme_get_menu(array(
             'source' => theme_get_option('theme_menu_source'),
             'depth' => theme_get_option('theme_menu_depth'),
             'menu' => 'primary-menu',
             'class' => 'hmenu'
         )
     );
     
     
Posted: Monday Jan 14th, 2013 at 11:18 am #37412

Do you have a horizontal menu already?

I had this issue with another site i was doing, but I realized I didn’t have a horizontal menu!

Posted: Monday Jan 14th, 2013 at 11:28 am #37425
James P
Username: TheTwister

Yes I do have a horizontal menu (I’m using a skeleton theme called _s)

Posted: Monday Jan 14th, 2013 at 11:41 am #37433

I’m kind of stuck then, Give me a bit and I’ll see what I can find out.

Posted: Monday Jan 14th, 2013 at 11:56 am #37455
James P
Username: TheTwister

Ahh okay, thank you.

Posted: Monday Jan 14th, 2013 at 12:06 pm #37468

I was passing on what I did for one of my sites, but it didn’t work for the second, so I will have to change that one and see where to put it! Sorry, you are getting my help sort of second hand. I know how frustrating that is. The fellow that was helping me had asked me to look in the pages.php file instead. You could try that?

Posted: Monday Jan 14th, 2013 at 1:18 pm #37487
James P
Username: TheTwister

No the code isn’t in the page.php file. My menu is inside header.php, but I can’t find that code.

This is the menu code i have in the header.

<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
  • This reply was modified 3 years, 11 months ago by  James P.
  • This reply was modified 3 years, 11 months ago by  James P.
  • This reply was modified 3 years, 11 months ago by  James P.
Posted: Monday Jan 14th, 2013 at 1:25 pm #37492

email me at marys477 at hotmail.com and I’ll see if I can help better. I’m only learning this now, and hoped that your site would be similar to mine.

Viewing 19 replies - 1 through 19 (of 19 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.