Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

store page hits in post meta WordPress


Well, Hello

I would like to track monthly pageviews for individual pages by storing the number of hits in the post meta. Every time the page is loaded, it should update the count. It should only take up one field, so you will need to think up a way to store (and then return) it in a single string along with the current month (e.g. MMMYY(Views), MMYY(Views) or something like that)

I would also like the code to display a list of all the stored data for months and views, also the current months data

At some point I would like to get this working with AJAX to reduce the performance impact, but perhaps thats a task for another question

Answers (2)


Julio Potier answers:


When you say "It should only take up one field", you want only use on meta field, right ?

I can do this now, please bear with me ;)

(i'm on skype if you want to chat about it, just PM me)

Julio Potier comments:

I've got your plugin, <strong>home made from scratch</strong>, here comes my test :

[[LINK href=""]][[/LINK]]
[[LINK href=""]][[/LINK]]

<em>My test post content :</em>
This post have been viewed [post_views] times.
Archives :[post_views all="yes"]

And also can be used like this :
[post_views id="123" month="01" year="2006"]
<em>This shortcode will display the archive views for post ID#123, January 2006.</em>

HTML code can be modified by yourself in the plugin of course...

Is it ok for you ? If yes, i can send the plugin, send me a mail by PM or come on skype julio.boiteaweb

See you soon