<p><code>.count</code> will return the total results for a particular paginated page (in your case, it should be the same as the <code>resultsLimit</code> variable).</p>

<p><code>.total</code> will return the number of results in the entire results object regardless of pagination.</p>

CC BY-SA 3.0
2014-08-14T20:36:41.213Z
2014-08-14T20:36:41.213Z
Ryan Shrum
<p>I found out that the functions count and total on the elementCriteriaModel show different results:</p>

<p>The following examples gave different results. <code>paginate.total</code> was the same as <code>total</code>, but not correct. Only count showed me the correct answer.</p>

<pre><code>{% paginate craft.entries(filterParams).section('object').order('title asc').limit(resultsLimit) as results %}

Total results:{{ paginate.total }}

{% set total =  craft.entries(filterParams).section('object').order('title asc').total() %}
{% set count =  craft.entries(filterParams).section('object').order('title asc').count() %}
</code></pre>

<entries><elementcriteriamodel>
What's the difference between total function and count function?
# What's the difference between total function and count function?

(Asked by: username_0 on 2014-08-14)

I found out that the functions count and total on the elementCriteriaModel show different results:
The following examples gave different results. paginate.total was the same as total, but not correct. Only count showed me the correct answer.
{% paginate craft.entries(filterParams).section('object').order('title asc').limit(resultsLimit) as results %}

Total results:{{ paginate.total }}

{% set total =  craft.entries(filterParams).section('object').order('title asc').total() %}
{% set count =  craft.entries(filterParams).section('object').order('title asc').count() %}

**Tags:** entries, elementcriteriamodel


---

## 1 answers

### Answer by username_1 on 2014-08-14. Score: 3

`.count` will return the total results for a particular paginated page (in your case, it should be the same as the `resultsLimit` variable).

`.total` will return the number of results in the entire results object regardless of pagination.


---

