title: wp redirect to same page in php
body: <p>on my website I restricted 3 pages (IDs 861, 869, 931) to all non-registered users but I'm having a problem, those pages will always redirect the user to the login page (even if I'm logged in), what I'm doing wrong? </p>
  
  <p>Here's the code, a little help would be greatly apprecieated</p>
  
  <pre><code>add_action( 'template_redirect', 'redirect_to_specific_page' );
  
  function redirect_to_specific_page() {
  
  if ( is_single('861') or is_single('869') or is_single(931) &amp;&amp;
  !is_user_logged_in() ) {
  
  wp_redirect( 'http://mywebsite.com/login', 301 ); 
  exit;
   }
  }
  </code></pre>