Disabled entries showing up On the following screenshot the image on the right called Crown Wood - Plot 1 is disabled in the CMS, so I'd like it not to show up in the results.

Below is my code. I added .status('live') to the for loop as suggested elsewhere in the forum but the disabled posts are still showing up.

Can someone help, as I only want the section to show live entries.



{% set var = craft.entries.positionedAfter(entry).level('2') %}
{% for entry in var.limit('5').status('live') %}
&lt;div class="related-carousel-cell"&gt;
  &lt;div class="property"&gt;
    &lt;a href="{{ entry.url }}"&gt;
      &lt;div class="wrap"&gt;
      {% if entry.plotGallery.first() %}
        &lt;img src="{{ entry.plotGallery.first().getUrl('relatedArticlesLarge') }}" class="property-image img-responsive" alt="{{ entry.title }}"&gt;
      {% endif %}
      &lt;/div&gt;
      &lt;div class="text"&gt;
        &lt;h2&gt;{{ entry.parent ? entry.parent.title }} - &lt;span style="white-space: nowrap;"&gt;{{ entry.title }}&lt;/span&gt;&lt;/h2&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;
{% endfor %}
The code is correct, it was that I hadn't disabled the individual entries in the CMS, I'd only disabled the parent in the structure.

So adding .status('live') on the end of the for loop is the solution, and making sure every entry at all levels is disabled.