Closed mattaellis closed 8 years ago
are you sure that the entry
variable is valid in your template? try hard-coding in the entry id to test if it is writing to the database.
Yes. For this specific page, {{ entry.id }}
outputs 436.
If I then try {% set count = craft.entryCount.count(436) %}
I'm still getting 0 and nothing is being written to the DB.
you'll need to increment the entry count for that entry id first...
{% do craft.entryCount.increment(entry.id) %}
Oh man! Sorry. Thanks Ben, that's what I was missing. Next time I'll RTFM :-0
sure thing
I've just added Entry Count Plugin included the
{% set count = craft.entryCount.count(entry.id) %}
and{{ count }}
tags on an entry template.The plugin is enabled, however, the count is alway returning '0'. I've tried switching the 'Ignore logged in users' option and the IP field is blank.
Nothing is being written to the DB, either for old and newly created entries. Though, if I manually add a row to the craft_entrycount table, it displays correctly.
Is there something I've missed? I'm on Craft Pro 2.5.2767