title: Wordpress the_content / post is empty
body: <p>I'm building my own template for Wordpress and I'm bumping into an issue when displaying the content of a post.</p>
  
  <p>I have already built one page template for the home page and it works fine. The loop outputs what I want to display. Now I'm building the template to display an article but the loop doesn't return anything.</p>
  
  <p>Here is the code of the page template:</p>
  
  <pre><code>&lt;?php
  /*
  Template Name: PAGE
  */
  define( 'WP_USE_THEMES', false );
  get_header(); 
  ?&gt;
  
  &lt;div class="wrapper"&gt;
      &lt;div class="sidebar"&gt;
      &lt;?PHP get_sidebar(); ?&gt;
      &lt;/div&gt;
      &lt;div class="main"&gt;
      &lt;div class="section group"&gt;
          &lt;div class="col col12-12"&gt;
              &lt;span&gt;
                  &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
                  &lt;?php endwhile; else : ?&gt;
                      &lt;p&gt;&lt;?php _e( 'Sorry, no posts matched your criteria.' ); ?&gt;&lt;/p&gt;
                  &lt;?php endif; ?&gt;
              &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;  
  &lt;?php get_footer(); ?&gt;
  </code></pre>
  
  <p>This results in displaying the "sorry, no posts matched your criteria" message when i click on one of the links on the homepage. The strange thing is that the page really exists (it has ID=26 as you'll see here below):</p>
  
  <pre><code>&lt;?php
  $post = get_post(26); 
  $title = $post-&gt;post_title;
  echo $title;
  ?&gt; 
  </code></pre>
  
  <p>This works and displays the expected title. I have tried get_the_ID(); to get the post ID but it returns an empty variable. </p>
  
  <p>There is probably something missing in my template but I can't figure out what.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks</p>