Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact
You are here: Home

Morgane

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 2, 2018 at 7:44 am in reply to: Hiding Code & Menu #15108
    Morgane
    Participant

    Finnaly I put this code in the function.php file and it works

    function redir() {
    	$location = get_site_url() . "/en/membership-login/";
    	 if(!SwpmMemberUtils::is_member_logged_in() && !is_page( array(17117, 17089, 17091, 17119, 17087, 17110) )) {
            wp_redirect( $location, 301 );
            exit;
        }
    }	
    add_action( 'template_redirect', 'redir' );

    Like that members are auto-redirect to login page when they’re not logged. 17117, 17089, … correspond to the ID of login page, registering page, password forget page, …

    August 2, 2018 at 7:37 am in reply to: Warning: count(): Parameter must be an array or an object that implements Counta #15107
    Morgane
    Participant

    Thank’s for your help !

    August 1, 2018 at 3:10 pm in reply to: Warning: count(): Parameter must be an array or an object that implements Counta #15097
    Morgane
    Participant

    No, I test with several users and it occurs each time.
    Version 7.2.5 of PHP

    July 23, 2018 at 1:09 pm in reply to: Hiding Code & Menu #14976
    Morgane
    Participant

    Good afternoon.

    It’s “normal” you have this error message, actually the correct URL is https://knowledgecenter.buymanager.biz/en/ (I haven’t create the redirection yet).

    And even if I deactivate the plugin, the problem is still here.

    N.B. : if you try to go on the site, you won’t see the page
    “This page isn’t working
    knowledgecenter.buymanager.biz redirected you too many times.
    Try clearing your cookies.
    ERR_TOO_MANY_REDIRECTS”
    because I remove the code

    /***  Auto redirect a user who isn't logged into the site ***/
    add_filter( 'pre_get_posts', 'swpm_auto_redirect_non_members' );
    function swpm_auto_redirect_non_members() {
        if( !SwpmMemberUtils::is_member_logged_in() && (!is_page(17089) || !is_page(17117) || !is_page(17091) || !is_page(17119) || !is_page(17087) || !is_page(17110) ) ) {
            wp_redirect( 'https://knowledgecenter.buymanager.biz/en/membership-login/' );
            exit;
        }

    when I’m working on it…

    July 20, 2018 at 2:02 pm in reply to: Hiding Code & Menu #14956
    Morgane
    Participant

    July 17, 2018 at 8:43 am in reply to: Hiding Code & Menu #14936
    Morgane
    Participant

    redirected too many time

    Sorry, I wrote it to fast without thinking :/
    If you cannot see the screenshot, here the real message :
    “This page isn’t working
    knowledgecenter.buymanager.biz redirected you too many times.
    Try clearing your cookies.
    ERR_TOO_MANY_REDIRECTS”

    July 16, 2018 at 7:39 am in reply to: Hiding Code & Menu #14929
    Morgane
    Participant

    Thank’s for your answer. I tried to code it on my own but it doesn’t work. So I find in the documentation this code :

    /***  Auto redirect a user who isn't logged into the site ***/
    add_filter( 'pre_get_posts', 'swpm_auto_redirect_non_members' );
    function swpm_auto_redirect_non_members() {
        if( !SwpmMemberUtils::is_member_logged_in() && (!is_page(17089) || !is_page(17117) || !is_page(17091) || !is_page(17119) || !is_page(17087) || !is_page(17110) ) ) {
            wp_redirect( 'https://knowledgecenter.buymanager.biz/en/membership-login/' );
            exit;
        }
    

    But it didn’t work either. It’s wrote that my website is redirect too many time. Do you know why ?

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
Next Page »

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy