• JPS Bhullar

    (@jpsbhullar)


    hi ! i am trying to use auth_redirect to validate the user logged in or not accordingly redirecting. but auth_redirect is showing login page correctly but not letting the user logged in.Even after providing correct user name and password, it does not allow the user to login and keep displaying the login page.
    I am writing the following module

    if(is_singular())
    {
    auth_redirect();
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter JPS Bhullar

    (@jpsbhullar)

    auth_redirect is not responding as mentioned in the documentation of wordpress. kindly share any idea how to implement the following:
    i am showing excerpts on homepage.whenever user clicks on read more link, he should be redirected to full post only if he is logged in.otherwise he should be redirected to login page and after login page, he should be sent to full post.

    Thread Starter JPS Bhullar

    (@jpsbhullar)

    Everyone here is quite lazy so I searched more and found the following solution for my problem

    I used the following code to check whether user is logged in before viewing the complete post.
    if(is_singular())
    {
    if(!is_user_logged_in())
    {
    auth_redirect();
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘auth_redirect not working’ is closed to new replies.