0

I have a for loop for all entries. There is no limit set, yet the loop is not displaying all the entries. The missing entries are the oldest. These missing entries do appear on category specific pages.

There are no errors. I have approximately 100 entries. The for loop is only displaying the most recent 80 or so.

Any ideas? Thanks

{% for post in craft.entries.section('posts') %}
                {% if loop.first and craft.request.pageNum == 1 %}  
                    <div class="box col-sm-4 col-md-6">
                    <div class="thumb featured dark-overlay">
                        <div class="photo">
                            <a href="{{post.url}}">
                                <img src="{{post.postImage.first().getUrl('featuredImage')}}" alt="" width="715" height="715">

                                <span class="info"><strong class="big-title">{{post.title}}</strong><span class="excerpt">{{post.tagline}}</span>
                                <em class="arrow-right"></em></span>
                            </a>
                        </div>
                    </div>
                </div>
                {% else %}
                <div class="box col-xs-6 col-sm-4 col-md-3">
                    <div class="thumb">
                        <div class="photo">
                            <a href="{{post.url}}">
                                <img src="{{post.postImage.first().getUrl('thumbImage')}}" alt="" width="434" height="434">
                                <span class="info"><strong class="title">{{post.title}}</strong>
                                    <!--<span class="excerpt">{{post.tagline}}</span>-->
                                <em class="arrow-right"></em></span>
                            </a>
                        </div>
                    </div>
                </div>      
                {% endif %}
                {% endfor %}                
4

Craft has a default limit of a 100 elements returned via an ElementCriteriaModel. To pull all elements, you'll need to explicitly set limit to null:

{% for post in craft.entries.section('posts').limit(null) %}
    ...
{% endfor %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.