Closed CreateSean closed 3 years ago
Make sure that entries
is a query.
I'm guessing you've already applied .all()
... don't do that until after you've sorted the query.
{% set entries = craft.entries.section('stuff') %} {# Don't apply .all() #}
{% do craft.viewCount.sort(entries) %}
{% for entry in entries.all() %}
I just installed the view count plugin, added the counter tag to the entry template
{% do craft.viewCount.sort(entries) %}
, hit a few entries at random and then added this:Then when I view a page where I'm trying to display the popular entries I get this error.
Based on the docs here: https://plugins.doublesecretagency.com/view-count/sort-by-most-viewed/ I assumed this is the correct approach.