<p>The issue was using two loops. I just needed the initial loop and referencing the loop call with the field-handle together. It now retrieves a single podcast.</p>

<pre><code>{% if block.type == "podcastBlock" %}
    {% set groupTitle  = craft.categories.group('podcasts').one() %}

    {% for podcast in block.podcastChannel %} 
        &lt;p class="subhead-section"&gt;{{ groupTitle }}&lt;/p&gt;
        &lt;audio class="mp3" controls&gt;
        &lt;source src="{{ podcast.audioFile.one.url }}" type="audio/mp3"&gt;
     {% endfor %} 
{% endif %}
</code></pre>

CC BY-SA 3.0
2017-10-26T19:45:02.427Z
Looping through queries is deprecated, that means sooner or later your `{% for podcast in block.podcastChannel %}` will trow an exception. Use `{% for podcast in block.podcastChannel.all() %}` instead. You can see this message in your control panel as well
Robin Schambach
CC BY-SA 3.0
2017-10-26T19:35:02.017Z
2017-10-26T23:24:52.100Z
2017-10-26T23:24:52.100Z
TRIM
<p>Try using the limit:1</p>

<pre><code>{% for entry in block.podcastChannel.limit(1) %}
</code></pre>

CC BY-SA 3.0
2017-10-26T19:18:17.740Z
2017-10-26T20:01:38.467Z
2017-10-26T20:01:38.467Z
Jim Wyse
<pre><code>{% if block.type == "podcastBlock" %}
    {% for category in block.podcastChannel %}
        {{category.title}} 

        &lt;audio class="mp3" controls&gt;

        {% for entry in block.podcastChannel %}
            &lt;source src="{{ entry.audioFile.one.url }}" type="audio/mp3"&gt;
        {% endfor %} 
    {% endfor %}
{% endif %}`
</code></pre>

CC BY-SA 3.0
2017-11-07T18:36:42.200Z
I'm guessing that you only want to pull in the `e2.mp3` file, is that right? Or you want to dynamically choose which one you show?
Cavell Blood
<matrix><forloop>
How to pull a single podcast source, using the Matrix field and loop?
# How to pull a single podcast source, using the Matrix field and loop?

(Asked by: username_0 on 2017-10-26)

{% if block.type == "podcastBlock" %}
    {% for category in block.podcastChannel %}
        {{category.title}} 

        

        {% for entry in block.podcastChannel %}
            
        {% endfor %} 
    {% endfor %}
{% endif %}`

**Tags:** matrix, forloop

> **Comments:**
> **username_1**: I'm guessing that you only want to pull in the `e2.mp3` file, is that right? Or you want to dynamically choose which one you show?  

---

## 2 answers

### Answer by username_0 on 2017-10-26. Score: 1 | Accepted answer

The issue was using two loops. I just needed the initial loop and referencing the loop call with the field-handle together. It now retrieves a single podcast.
{% if block.type == "podcastBlock" %}
    {% set groupTitle  = craft.categories.group('podcasts').one() %}

    {% for podcast in block.podcastChannel %} 
        {{ groupTitle }}
        
        
     {% endfor %} 
{% endif %}

> **Comments:**
> **username_2**: Looping through queries is deprecated, that means sooner or later your `{% for podcast in block.podcastChannel %}` will trow an exception. Use `{% for podcast in block.podcastChannel.all() %}` instead. You can see this message in your control panel as well  

---

### Answer by username_3 on 2017-10-26. Score: 1

Try using the limit:1
{% for entry in block.podcastChannel.limit(1) %}


---

