title: Wordpress image path is correct but image does not display on site
body: <p>I have a very simple piece of PHP code where I get the image upload path in Wordpress, and if I insert the path into my browser the image is found is displays correctly, so I know the path is correct. But on the site it does not display. I am working on localhost.</p>
  
  <p>Here is what I have tried:</p>
  
  <pre><code>$uploads = wp_upload_dir();
  
  $path = $uploads['basedir'] . '/12hours/';
  
  date_default_timezone_set('Africa/Johannesburg');
  
  $hour = date("H");
  
  if ($hour == 10) {
      echo 'it is 10am &lt;br&gt;';
      echo '&lt;img src="' . $path . '6-60.jpg" data-src="' . $path . '6-60.jpg" class="img-fluid lazy" alt="something" /&gt;';
  }
  </code></pre>
  
  <p>When I inspect the element on my site the path looks like this:</p>
  
  <pre><code>/Users/myname/Sites/mysite/wp-content/uploads/12hours/6-60.jpg
  </code></pre>
  
  <p>And when I insert the path in a new tab in the browser the image does load. </p>
  
  <p>What could the issue be?</p>