Ask your WordPress questions! Pay money and get answers fast! (more info)

store page hits in post meta

  • SOLVED

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)

2011-11-16

Julio Potier answers:

Hello

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="http://demo.boiteaweb.fr/the-title-for-julio-posst1-2-1972.html"]]http://demo.boiteaweb.fr/the-title-for-julio-posst1-2-1972.html[[/LINK]]
[[LINK href="http://dl.dropbox.com/u/45956904/ScreenShots/baw_111116-144659.png"]]http://dl.dropbox.com/u/45956904/ScreenShots/baw_111116-144659.png[[/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