<p>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.</p>

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

CC BY-SA 3.0
2017-01-17T11:33:38.737Z
`.status('live')` shouldn’t be required as it is the default for the status param anyway.
carlcs
CC BY-SA 3.0
2017-01-17T11:20:47.110Z
2017-01-17T11:20:47.110Z
mention79
<p>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.</p>

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

<p>Can someone help, as I only want the section to show live entries.</p>

<p><a href="https://i.sstatic.net/vR48M.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vR48M.png" alt="enter image description here"></a></p>

<pre><code>{% 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 %}
</code></pre>

CC BY-SA 3.0
2017-01-17T11:14:18.690Z
I some sort of Caching at play here?
KSPR
CC BY-SA 3.0
2017-01-17T11:16:27.237Z
I've already tried clearing the cache and have cache killer plugin on the browser active
mention79
<entry><structure>
Disabled entries showing up
# Disabled entries showing up

(Asked by: username_0 on 2017-01-17)

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') %}

  
    
      
      {% if entry.plotGallery.first() %}
        
      {% endif %}
      
      
        {{ entry.parent ? entry.parent.title }} - {{ entry.title }}
      
    
  

{% endfor %}

**Tags:** entry, structure
> **Comments:**
> **username_1**: I some sort of Caching at play here?  
> **username_0**: I've already tried clearing the cache and have cache killer plugin on the browser active  

---

## 1 answers

### Answer by username_0 on 2017-01-17. Score: 2

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.

> **Comments:**
> **username_2**: `.status('live')` shouldn’t be required as it is the default for the status param anyway.  

---

