title: How to link featured image to a page on Wordpress for non-loggedin users in single.php?
body: <p>I'd like to link featured images of Wordpress to an existing page for non-members (not logged-in users) in single.php (just for posts).</p>
  
  <p>Tried this code but no success:</p>
  
  <pre><code>&lt;?php 
      if (has_post_thumbnail( $post-&gt;ID ) ) {
          &lt;?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post-&gt;ID ), 'large' );
          $image = $image[0];
      }
  ?&gt;
  </code></pre>
  
  <p>So how can I link all of the featured images in posts to one page on Wordpress for non-logged in users (visitors) ? 
  Note: This is for all featured images on the site inside posts. </p>