<p>Use <code>status(['live','pending'])</code> to get all entries with both states.</p>

<p>Later, to get the linked entry you need to setup a custom route like `podcasts/{slug}. In the template you query the entry like this:</p>

<pre><code>{% set slug = craft.request.lastSegment() %}
{% set entry = craft.entries.slug(slug).status(['live', 'pending']).one() %}
</code></pre>

CC BY-SA 4.0
2019-01-14T07:51:06.473Z
2019-01-14T08:26:05.530Z
2019-01-14T08:26:05.530Z
Oliver Stark
<p>Craft 3.0.37</p>

<p>I have the following code which I expect to output all entries (live and pending) but it doesn't</p>

<pre><code>&lt;ul&gt;
  {% for entry in craft.entries.section('podcast').status('live','pending').relatedTo(season).orderBy('postDate', 'asc').all() %}
    &lt;li &gt;&lt;span&gt;{{ entry.episodeNumber }}&lt;/span&gt; &lt;a href="{{ entry.url }}"&gt; {{ entry.title }}&lt;/a&gt;&lt;/li&gt;
  {% endfor %}
&lt;/ul&gt;
</code></pre>

<p>If I change the status to only pending it outputs pending entries, if live, outputs live. However it will not output both pending and live.</p>

<p>Please advise.</p>

<templating><entries><status><pending>
live and pending entries together not working
# live and pending entries together not working

(Asked by: username_0 on 2019-01-13)

Craft 3.0.37
I have the following code which I expect to output all entries (live and pending) but it doesn't

  {% for entry in craft.entries.section('podcast').status('live','pending').relatedTo(season).orderBy('postDate', 'asc').all() %}
    {{ entry.episodeNumber }}  {{ entry.title }}
  {% endfor %}


If I change the status to only pending it outputs pending entries, if live, outputs live. However it will not output both pending and live.
Please advise.

**Tags:** templating, entries, status, pending


---

## 1 answers

### Answer by username_1 on 2019-01-14. Score: 1 | Accepted answer

Use status(['live','pending']) to get all entries with both states.
Later, to get the linked entry you need to setup a custom route like `podcasts/{slug}. In the template you query the entry like this:
{% set slug = craft.request.lastSegment() %}
{% set entry = craft.entries.slug(slug).status(['live', 'pending']).one() %}


---

