Answers.Body: <pre><code>{% for entry in craft.entries.section('News').relatedTo(57).limit(1).all() %}
  </code></pre>
  
  <p>does work! 57 being the Category ID in this case. Thanks for the help.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-12T16:43:38.360Z
Answers.LastActivityDate: 2019-07-12T16:43:38.360Z
Answers.UserDisplayName: Bardo_J
Body: <p>I see a few answers that look, hopefully, way more complicated than I'm looking for. I simply want to loop through entries with a normal for loop like:</p>
  
  <pre><code>{% for entry in craft.entries.section('News').limit(1).all() %}
  loop through entries of a specific category only here
  {% endfor %}
  </code></pre>
  
  <p>Is there no way just to throw on something like .category('BreakingNews') onto that chain?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:10:43.830Z
Comments.Text: https://craftcms.stackexchange.com/a/18951/9038
Comments.UserDisplayName: Piotr Pogorzelski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:21:30.057Z
Comments.Text: @piotrpog this is grabbing a category ID. I don't see Category ID's in my Categories control panel. I just see the full name with spaces (i don't even see a shortened camelCase reference name)
Comments.UserDisplayName: Bardo_J
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:24:33.583Z
Comments.Text: You can see category ID in Sections page. Please go to Dashboard->Setting->Sections. Each category has its ID in its URL.
Comments.UserDisplayName: Kota.M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:28:45.943Z
Comments.Text: @Kota.M perhaps i have this setup wrong. In the Sections page, I have Section Name, Section Handle, Section Type and Entry Types. If i click on the name of the Section I have Name, Handle, Section Type and Site Settings (URL/slug)
Comments.UserDisplayName: Bardo_J
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:30:36.967Z
Comments.Text: Could you move your mouse cursor on a category's Name? I suppose a URL shows up, and it has the category's ID.
Comments.UserDisplayName: Kota.M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:37:01.230Z
Comments.Text: @Kota.M I don't see any hover state, but if I inspect the link with dev tools, I see a data-id attribute with an integer in there. Surely that can't be the way one parses a category?
Comments.UserDisplayName: Bardo_J
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:42:55.217Z
Comments.Text: Sorry, I misunderstood. I thought it is section. But I suppose you can get a category by its handle or ID, as well as section. In Dashboard->Setting->Categories.
Comments.UserDisplayName: Kota.M
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-12T14:52:45.003Z
Comments.Text: @Kota.M I figured out where to expose those Category ID's. In the Dashboard, select Categories and under the list of the Category Groups, there's a little gear icon that lets you check a box that adds and ID column.
Comments.UserDisplayName: Bardo_J
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-12T08:30:01.067Z
Comments.Text: Possible duplicate of [Get entries which have a certain category assigned to them](https://craftcms.stackexchange.com/questions/4127/get-entries-which-have-a-certain-category-assigned-to-them)
Comments.UserDisplayName: Jamie Wade
Tags: <craft3>
Title: in a for loop, how do i only display entries of a certain category?
ThreadText: # in a for loop, how do i only display entries of a certain category?
  
  (Asked by: username_0 on 2019-07-12)
  
  I see a few answers that look, hopefully, way more complicated than I'm looking for. I simply want to loop through entries with a normal for loop like:
  
  ```
  {% for entry in craft.entries.section('News').limit(1).all() %}
  loop through entries of a specific category only here
  {% endfor %}
  
  ```
  
  Is there no way just to throw on something like .category('BreakingNews') onto that chain?
  
  **Tags:** craft3
  
  > **Comments:**
  > **username_1**: https://craftcms.stackexchange.com/a/18951/9038  
  > **username_0**: @piotrpog this is grabbing a category ID. I don't see Category ID's in my Categories control panel. I just see the full name with spaces (i don't even see a shortened camelCase reference name)  
  > **username_2**: You can see category ID in Sections page. Please go to Dashboard->Setting->Sections. Each category has its ID in its URL.  
  > **username_0**: @username_2 perhaps i have this setup wrong. In the Sections page, I have Section Name, Section Handle, Section Type and Entry Types. If i click on the name of the Section I have Name, Handle, Section Type and Site Settings (URL/slug)  
  > **username_2**: Could you move your mouse cursor on a category's Name? I suppose a URL shows up, and it has the category's ID.  
  > **username_0**: @username_2 I don't see any hover state, but if I inspect the link with dev tools, I see a data-id attribute with an integer in there. Surely that can't be the way one parses a category?  
  > **username_2**: Sorry, I misunderstood. I thought it is section. But I suppose you can get a category by its handle or ID, as well as section. In Dashboard->Setting->Categories.  
  > **username_0**: @username_2 I figured out where to expose those Category ID's. In the Dashboard, select Categories and under the list of the Category Groups, there's a little gear icon that lets you check a box that adds and ID column.  
  > **username_3**: Possible duplicate of [Get entries which have a certain category assigned to them](https://craftcms.stackexchange.com/questions/4127/get-entries-which-have-a-certain-category-assigned-to-them)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-07-12. Score: 1
  
  ```
  {% for entry in craft.entries.section('News').relatedTo(57).limit(1).all() %}
  
  ```
  
  does work! 57 being the Category ID in this case. Thanks for the help.
  
  
  ---
  
  