This topic has 4 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #201630
     hamsar
    Participant

    Hi,

    I was given this code to restrict non logged users and redirect them to the register page. Now however this code seems to block the activation of users account. When a user receives the activation link they are redirected to the register page although the page is allowed in the snippet. I flushed out all cache, deactivated pluggins but the problem was with the snippet. Can you please recheck this snippet. I have provided admin access to the back end.

    Thanks

    Hamsar.co/wp-admin

    hamsar 
    #dS5(xcXoi#U1#

     

    // Restrict guests access function sq7R_kleo_restrictions_guest_restrict() { $allowedpages = array(‘register’,’activate’,’home’); if( !is_user_logged_in() && !is_page($allowedpages) ) { wp_redirect(site_url( ‘/register’) ); } } add_action(‘template_redirect’, ‘sq7R_kleo_restrictions_guest_restrict’);

    #201632
     Kieran_SQ
    Moderator
    Not marked as solution
    #201675
     hamsar
    Participant
    Not marked as solution
    #201865
     hamsar
    Participant
    Not marked as solution
    #201901
     Radu
    Moderator
    Not marked as solution
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?