[Resolved] Ajaxize for WP Post Views ?
Thanks for this great tool ! I would like to know how to ajaxize WP Post Views plugin in order to make it work with W3 Total Cache and Varnish Cache. In fact, WP Post Views doesn’t increment well counters of posts because of caching solutions we have on our blog.
I tried to ajaxize ‘the_views’ function, but the counter displays “0 views” rather than the real amout of views.
Thanks in advance 😉
I’m not entirely sure to be honest. Had a quick-check and got the same behaviour as you. I’m not familiar with this particular plugin, but it might check the views based on information in the page/post itself, and therefore, when accessed via the ajax call, it doesn’t get the contextual information it needs…
Don’t think there’s much I can do about that, but best thing is to contact the plugin author.
I did however notice on the plugin info that it claims to work with caching solutions.
Thank you very much for your help. Unfortunately, the author of WP Post Views is not able to provide support since 1 year, so I don’t find any solutions for this specific problem, and no alternative for counting views on articles.
WP Post Views runs fine with WP Super Cache but unfortunately not with W3 Total Cache (and less for server caching solutions like varnish): I noticed a big decrease of number of readings since cache has been installed on my server, so the only solution would be an ajax counting views.
Have you tried http://scratch99.com/wordpress-plugin-ajax-the-views/ ?
Hope you’re fine, and thousand and thousand thanks for your help.
I didn’t understand exactly what is the changes provoqued by the code you sent me, is it not the same that ajax_the_views launches at the footer page ? Anyway, I implemented it into my code and it didn’t change anything: “Please wait” continues to show rather than the views.
Let me know !
As I said it’s a very ‘quick-n-dirty’ fix, so perhaps not what you should be searching for. I suggest posting on other forums or searching for different post-views plugins if you can’t get this to work.
Hello Yoav ! It works like a charm ! Awesome, the plugin counts now the views in real time 🙂 I don’t know if you can, but I think you should update the plugin Ajax_the_views on the wordpress plugins library.
Strange fact: your hack didn’t run well immediately on my blog (but worked on another test blog), but after putting your code on the header and not footer, it has worked. Note that I deleted the precedent code on the ajax_the_views PHP file, hope i made things correctly.
Thnk you so much !!!!!
Glad it helped evo252. It’s not that simple to update somebody else’s plugin code. Usually you’d have to ask them for permission, and some times make another plugin copy… Not exactly what I had in mind when I created Ajaxize. I’m not even sure my fix is the right one. As I said, it was very quick and perhaps not the most elegant way to solve this problem.
The best thing you can do is post a message on the ajax_the_views forum and ask about it. You can probably also point to this thread / code in pastebin. I know I can do it too, but since I’m not actually using this plugin, I feel it might be inappropriate in this case.
Ok, I understand, it’s as u like. I think however that the fix is correct, because the tool is working very well 😉
Thank u so much…
No problem. If you want to help others, I really suggest you post something on the ajax_the_views plugin forum. It’s up to you of course.
I wanted to say you thanks again, because I’m so indebted to you for the time you gave me to fix the bug of this plugin !
I’ve posted a message to inform those who could have the same problem as me on the plugin forum !
Thank u so much…!
Thanks for doing it.
BTW, Ajaxize 1.1 now supports context information, and should in theory also work with functions like the_views.
I guess you already have a working solution for WP Post Views, but you might want to do it through ajaxize. If it works it might be slightly more elegant, and no need to tweak footer/header php files.
I’m not really sure what ajaxize is suppose to do.
Is it about making the site more w3c standard compliant by making other plugin authors coding hook to output only 1 code that is required rather than many duplicates ?
Sorry, bit of a nub here :X
- The topic ‘[Resolved] Ajaxize for WP Post Views ?’ is closed to new replies.