So, I have a loop that populates all the entries related to a given category. See below. I have multiple categories. Right now, I use the same code for each category - swapping only the name of the category out (e.g, category1, category2 ...). How can I build a loop that avoids this?
My current template is as follows. I did not include the repetition for each category.
<div class="margin-2"></div>
{% set category = craft.entries.seciont('posts') %}
<h6>Aircraft</h6>
<div class="sep red margin-1"></div>
<div class="owl-carousel owl-thumbs">
{% for entry in category.relatedTo(craft.categories.slug('category1')) %}
<div class="thumb dark-overlay">
<div class="photo">
<a href="{{entry.url}}">
<img src="{{ entry.postImage.first().getURL('thumbImage')}}" alt="" width="235" height="235">
<span class="info"><span class="big-excerpt"> {{ entry.title }} k</span></span>
</a>
</div>
</div>
{% endfor %}