Closed claraloustau closed 2 years ago
hi. you can use the static method and forward the id of the page https://github.com/bnomei/kirby3-pageviewcounter/blob/c0f21cbf21a7084d75cc257b5e603363364f6bcb/classes/PageViewCounter.php#L65
in you template like default.php
<?php
echo \Bnomei\PageViewCounter::singleton()->count($page->id());
fixed should have been \Bnomei\PageViewCounter::singleton()->count($id)
Thank you @bnomei !
Is there a way to make a sortBy() on the count($id) for a blog ?
Something like :
$mostclicks = $page->children->sortBy(\Bnomei\PageViewCounter::singleton()->count($id), 'desc');
Hello bnomei, is there a way to convert 1000 to 1k ? thank you
try $formatedSize = I18n::formatNumber($count);
Hello, Thanks for your plugin ! Is there a way to display the counter in the front end ? Thanks