Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-14T07:51:06.473Z
Answers.LastActivityDate: 2019-01-14T08:26:05.530Z
Answers.LastEditDate: 2019-01-14T08:26:05.530Z
Answers.UserDisplayName: Oliver Stark
Body: <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>
  
Tags: <templating><entries><status><pending>
Title: live and pending entries together not working
ThreadText: # 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
  
  ```
  <ul>
    {% for entry in craft.entries.section('podcast').status('live','pending').relatedTo(season).orderBy('postDate', 'asc').all() %}
      <li ><span>{{ entry.episodeNumber }}</span> <a href="{{ entry.url }}"> {{ entry.title }}</a></li>
    {% endfor %}
  </ul>
  
  ```
  
  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() %}
  
  ```
  
  
  ---
  
  