membership urls

hey i am trying to add membership to multisite

i have the plugin network activated

1) how do can i enable multisite urls.
2) my site does not have paid membership. i only want to restrict logged in users to access some custom pages. can i do that with membership? these are not post or pages but custom pages.

  • DavidM
    • DEV MAN’s Mascot

    Hi nelnehal,

    By multisite urls do you mean you'd like to be able to restrict access to sub-site urls on your multisite? If so, the only way I know to achieve that would be to set the global tables value to true either in /membership/membershipincludes/includes/membership-config.php as follows:
    if(!defined('MEMBERSHIP_GLOBAL_TABLES')) define( 'MEMBERSHIP_GLOBAL_TABLES', true);

    Or by specifying the following in wp-config.php:
    define( 'MEMBERSHIP_GLOBAL_TABLES', true);

    With that done, your rules will persist from site to site and you could then use URL Groups to restrict access depending on urls. It's quite a tricky beast though, since for instance Posts and Pages don't exactly persist from site to site. It takes some configuration work to get things working the way you want with that setup.

    Regarding restricting custom pages, do you mean actual html/php pages? If so, there's not a way for Membership to restrict those currently but you may be able to make those pages into WordPress page templates then apply those page templates to actual WordPress pages that you should then be able to restrict.

    How would that work for you?

    Cheers,
    David

  • nelnehal
    • The Incredible Code Injector

    i think i will look for something simpler for this case. i only need 3 pages per site ( have 10 sites) restricted to logged in uses. and yea this pages are html/php pages?

    there is a plugin will restrict logged in access to pages, but not custom pages.

  • DavidM
    • DEV MAN’s Mascot

    Hi nelnehal,

    I really couldn't see a way to do that apart from creating a custom page template for those particular pages. Page templates could easily use is_user_logged_in() within the template itself, to detect the user being logged in, so you wouldn't even need a plugin in that case.

    Other than that, I don't know how that could be done.

    Cheers,
    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.