Answers.Body: <p>Updating for Craft3 and calling for different types, I wanted to share how I use the entry types to create different header/slider entry.</p>
  <pre><code>{% set slides = craft.entries().section('slider') %}
  {% set entries = slides.all() %}
  {% for entry in entries %}
      {% if entry.type == 'type1' %}
          {# Your content for 'type1' Entry here #}
      {% endif %}
      {% if entry.type == 'type2' %}
          {# Your content for 'type2' Entry here #}
      {% endif %}
      {% if entry.type == 'type3' %}
          {# Your content for 'type3' Entry here #}
      {% endif %}
  {% endfor %} 
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-12T00:15:19.427Z
Answers.LastActivityDate: 2020-10-12T00:15:19.427Z
Answers.UserDisplayName: Cynder Gray
Answers.Body: <pre><code>{% set entries = craft.entries.section('pages').type('blogPost') %}
  
  {% for entry in entries %}
     {{ entry.title }}
  {% endfor %}
  </code></pre>
  
  <p>Is what I have cobbled together... any pointers on improvements would be welcome.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-05T13:32:11.737Z
Answers.Text: That's exactly how to do it!
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-05T19:43:04.367Z
Answers.Text: Cheers Brad much appreciated.
Answers.UserDisplayName: bobbyballbags
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-05T10:19:04.667Z
Answers.LastActivityDate: 2014-07-05T13:31:51.233Z
Answers.LastEditDate: 2014-07-05T13:31:51.233Z
Answers.UserDisplayName: bobbyballbags
Body: <p>I would like to loop through entries in a channel but only the ones for a specific entry type. Is this Possible?</p>
  
  <p>I'm using the free version of craft on a test site, I have used the channel for my pages but also want to set up a blog. I have set up a blogPost entry type, is there a way to target this in a loop?</p>
  
Tags: <entry-type><loop><forloop>
Title: How do I loop through entries for a specific entry type?
ThreadText: # How do I loop through entries for a specific entry type?
  
  (Asked by: username_0 on 2014-07-05)
  
  I would like to loop through entries in a channel but only the ones for a specific entry type. Is this Possible?
  
  I'm using the free version of craft on a test site, I have used the channel for my pages but also want to set up a blog. I have set up a blogPost entry type, is there a way to target this in a loop?
  
  **Tags:** entry-type, loop, forloop
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2014-07-05. Score: 14 | Accepted answer
  
  ```
  {% set entries = craft.entries.section('pages').type('blogPost') %}
  
  {% for entry in entries %}
     {{ entry.title }}
  {% endfor %}
  
  ```
  
  Is what I have cobbled together... any pointers on improvements would be welcome.
  
  > **Comments:**
  > **username_2**: That's exactly how to do it!  
  > **username_0**: Cheers username_2 much appreciated.  
  
  ---
  
  ### Answer by username_1 on 2020-10-12. Score: 1
  
  Updating for Craft3 and calling for different types, I wanted to share how I use the entry types to create different header/slider entry.
  
  ```
  {% set slides = craft.entries().section('slider') %}
  {% set entries = slides.all() %}
  {% for entry in entries %}
      {% if entry.type == 'type1' %}
          {# Your content for 'type1' Entry here #}
      {% endif %}
      {% if entry.type == 'type2' %}
          {# Your content for 'type2' Entry here #}
      {% endif %}
      {% if entry.type == 'type3' %}
          {# Your content for 'type3' Entry here #}
      {% endif %}
  {% endfor %} 
  
  ```
  
  
  ---
  
  