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') %}
<div class="related-carousel-cell">
<div class="property">
<a href="{{ entry.url }}">
<div class="wrap">
{% if entry.plotGallery.first() %}
<img src="{{ entry.plotGallery.first().getUrl('relatedArticlesLarge') }}" class="property-image img-responsive" alt="{{ entry.title }}">
{% endif %}
</div>
<div class="text">
<h2>{{ entry.parent ? entry.parent.title }} - <span style="white-space: nowrap;">{{ entry.title }}</span></h2>
</div>
</a>
</div>
</div>
{% endfor %}