Rating based off of number of comments or views

I would not take visits into account: To get these numbers you have to connect to an external table, or worse write into the WordPress tables on each request. Use comments, that is built-in. Here is a sample code that adjusts itself to your comment development: add_filter( ‘the_content’, ‘wpse_78513_hotness’ ); function wpse_78513_hotness( $content ) { … Read more

Adding a content rating system

Custom field will do the task. On the post page there’s nothing to do great, just create a Custom Field called agerating or age-rating. Authors will enter the value of the field according to their content with G/PG/R/X. Then at the frontend, edit single.php. Use this code inside the loop to retrieve the rating value: … Read more

Post rating using Custom Field

First off, you should consider using using the building WordPress functionality rather than linking straight to a PHP file. Anyone could game that very easily and artificially vote up posts. To use the wordpress ajax functionality, send your ajax request to yoursite.com/wp-admin/admin-ajax.php, and use standard plugin hooks system. Tollmanz’s response is right on: your update … Read more

How to store post rating system data post independent?

What you want is actually pretty easy to achieve. The code from the tutorial you used saves and gets the data post dependent via update_post_meta() and get_post_meta(), which doesn’t suit your use case. You just have to store your data post independent. This thought relates to the array of IP keys and time values you … Read more