Hello!
The views counter is only considering the views made from the moment when it was actived. It isn’t counting all my stats history.
How do I resolve this? I changed theme, and do not want to miss the views.
You have to change the data field for the php file to whatever your existing views datafield is (in my case it was ‘views’)
Edit this file:
/includes/wp-booster/td_page_views.php
change the field name here (at top of file) to whatever your existing datafield name is for views:
static $post_view_counter_key = 'views';
The file looks like this:
<?php
class td_page_views {
static $post_view_counter_key = ‘views’;
But it worked.
when I update the page it resets the views o.O
sorry, I meant what did NOT work
=(
replace it:
<?php
class td_page_views {
static $post_view_counter_key = ‘post_views_count’;
for this
<?php
class td_page_views {
static $post_view_counter_key = ‘views’;
Yes.. you need to change it to whatever YOUR data key happens to be for your existing counts.
Mine is “views” – yours might be something totally different based on whatever plugin you were using before. The theme plugin can’t “magically” figure out your reads from the past unless you were ALREADY counting those since day one or whenever.
So, typically if you were using a plugin there might be a data field (sometimes a custom field you can find at bottom of your post editing pages with other custom fields), and if the plugin was from Acme co, they might have made a data field like
acme_post_views
so, you would then need to update the theme file to tell it to READ and WRITE to that existing field (in my case it’s ‘views’ — for the theme if you have no other counter, it would now use the “post_views_count” — you will see this field in the custom fields at bottom of your posts when editing one).
SO, *you* need to figure out what your old data field is and put THAT field into the php file. 🙂