WordPress.org

Ready to get started?Download WordPress

Forums

auth_redirect not working (3 posts)

  1. JPS Bhullar
    Member
    Posted 3 years ago #

    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();
    }
  2. JPS Bhullar
    Member
    Posted 3 years ago #

    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.

  3. JPS Bhullar
    Member
    Posted 3 years ago #

    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();
    }
    }

Topic Closed

This topic has been closed to new replies.

About this Topic