There seem to be very few tutorials out there about how to write a PHP script to show the “Most Viewed” posts. I’ve found some scripts custom made for WordPress and haven’t been able to get any of them to work for me. The rest are most popular php scripts for programmers.
I have table called news with the fields id, count, timestamp, headline, img, text.
I want to get the 5 most popular posts for the last week showing just number and headline.
How can I go about this?
This will grab 5 records from within the last week with the highest
countvalueEDIT
An easy way to increase the count field by 1 and update the timestamp