posts view in v.3.5

Posted in: Newspaper
Post count: 23

After upgrading to 3.5 there was a problem with the posts view on the main page for BLOCK 2. Values ​​increased by hundreds of times and became the same for all records. See https://redpen.io/m876ky
If go back to the previous version are all displayed correctly https://redpen.io/38pfxc

Post count: 854

hi,
do you have the plugin Wp-postview installed?
please disable this plugin. here the documentation page on this plugin: https://forum.tagdiv.com/wp-postviews-post-view-counter-alternative-for-w3-total-cache/

Thanks for you message.
Radu A.

Post count: 23

Hi.
I have WP-PostViews + W3 Total Cache. If i disable WP-PostViews, i lost all statistics.
Maybe you did not understand me, when i upgrade to 3.5 problem occurs with only one block 2 on the main page. For example, if you upgrade to the counter in the block shown for each of the three records 100, 75, 90, then after the update immediately see 4500, 4500, 4500. I disabled W3 Total cache, deleted a сache folder, the problem remained.

Post count: 23

If I go to the post from block 2 and there I see the correct data counter, ie the only problem is for one block on the home page.

Post count: 3343

Hi,
What you can do is to check a post from Block 2, edit it and take a look on custom fields and see what value have there, because in 3.5 if you use that plugin WP-PostViews the views will be read from views and not from theme counter post_views_count

Post count: 57

I have the same problem, with block 7. This same huge count for all posts is homepage views count, not posts. How did you fix it?

Post count: 3343

Hi,

@dan21
can you show me your site URL to see the issue.

Post count: 57

it’s http://art-post.me – the views on homepage is the same, but when you click on any post, the counters display what they are supposed to (with cache plugin or without any). If you could help, that would be great.

Post count: 3343

Hi,
The theme have the default counter and also support that plugin WP-PostViews that works with cache plugin.

If you have installed that plugin the theme will read the count from that plugin.

If you edit a post you will have 2 custom fields that keep the views(1 is the default one and another one is from that plugin WP-PostViews)

http://screencast.com/t/NFWjdEqkKM

You can easily check you counter, go to a post, make refresh and see if the counter work, should update on each refresh.

Post count: 15

Hi there,
I had the same problem. It’s due to the fact that the the_views function in wp-postviews.php reads the value of the “views” custom field from the homepage instead of the single posts mentioned in the blocks, so all counters on the homepage show the same value.
I fixed this commenting out
//$post_views = the_views(false); in td_module.php
and adding
$post_views = get_post_meta( $this->post->ID, 'views', true );
which reads the value of the views custom field of each single post. It seems to be working so far… but be careful, it has some implications, as it overrides the the_views function.

Post count: 161

Is it true that if you disable the WP-PostView you will lose all view counts? If yes, than how can you ever update the wordpress core, the theme or plugin? You should always disable all plugins when updating…

Post count: 57

@PhilDbz Thank you SO MUCH! It does work! Wow! Thank you!

Post count: 9544

NOTE:
update to WP-Postview for those using with cache:

Version 1.67
•NEW: Allow user to not use AJAX to update the views even though WP_CACHE is true

Post count: 23

@PhilDbz thank you!

Post count: 161

Hi PhilDbz,

It looks like tagDiv changed the td_module.php file because I can’t find the line you are referring to. Does anyone know how to fix this? I’m on version 3.6.

Thanks!

Post count: 161

Sorry, i was looking at the module file in content_builder instead of wp_booster folder. My bad!

Post count: 161

I fixed it! Thanks Phil! Now another ‘problem’ occurs. The counts are not shown in the theme’s layout. For example, normally it would show 10.000 views. Now it will show 10000 vies, without the seperation dot for thousands. Any idea on how to fix this?

Post count: 3343

Hi,
You mean here: http://screencast.com/t/w9Xx8C1qVipi We will take a look.

Thanks for the message!

Post count: 161

Yeah like that, if I recall correctly the numbers were shown with a dot seperator and a customizable text like “views” or “times viewed” behind it. The text doesn’t show up anymore with this fix. So on post pages it only shows the number without the text “views”.

Post count: 15

@r1kay, sorry for the late reply, I was out of town on vacation and couldn’t check the code. Here’s a quick fix, which still overrides the the_views function of wp-postviews, but fixes the issue with the thousand’s dot not showing and the text “views” not showing:

on line 153, where it says
$buffy .= $post_views;
change this with
$buffy .= number_format_i18n($post_views).' addwordhere';

this will change the format of $post_views created on line 152 and concatenate that with a word of your choice (change addwordhere with whatever you like, but make sure to leave a blank before the word).

Make sure you also make the original modification to line 152 I mentioned in my previous reply (https://forum.tagdiv.com/topic/posts-view-in-v-3-5/#post-10902).

This is not the best solution… It seems to work fine, but it would be better to change the “the_views” function in wp-postviews instead, or call its settings from here so you woudln’t have to concatenate manually the text “views”… in the meantime I hope it works, let me know (it works on my site).

Cheers!

  • This reply was modified 12 years by PhilDbz. Reason: wrong line number, corrected
Post count: 161

Just updated the theme to the latest version, but the problem still persist! Thought they would fix this problem in the latest update but appearently they didn’t. Or is it just me? Can anyone else confirm that this workaround is still needed?

Post count: 15

I’m still using the workaround above, for now… but in the update info it said that something had indeed been changed in the views counter. Not sure what, though…

Viewing 22 posts - 1 through 22 (of 22 total)
The forum ‘Newspaper’ is closed to new topics and replies.