Undefined index: ratings_score …/wp-postratings.php on line 994

when ever you expect something to be an array, it’s good practice to check to see if it is first before proceeding. so the new code might read like this: if(is_null($post_ratings_data)) { $post_ratings_data = get_post_custom($post_id); if ( is_array( $post_ratings_data[‘ratings_users’] ) ) { $post_ratings_users = intval($post_ratings_data[‘ratings_users’][0]); $post_ratings_score = intval($post_ratings_data[‘ratings_score’][0]); $post_ratings_average = floatval($post_ratings_data[‘ratings_average’][0]); } }

WP-PostRatings: list current user’s rated posts

Plugin questions are best asked on the plugin’s support forum. But this code is wrong: $result = $wpdb->get_results($sql) or die(mysql_error()); foreach( $results as $result ) { echo $result->name; } The foreach is backwards. Go for this (corrected $result to $results in the first line – added ‘s’): $results = $wpdb->get_results($sql) or die(mysql_error()); foreach( $results as … Read more

How to create a page which lists all categories with its ratings [closed]

Copy the entire function to the page that you want to have your average ratings: <?php // Lets get the id of every existing category $output_categories = array(); $categories = get_categories($args); //We loop through every category to calculate the average rating score of it’s posts foreach($categories as $category) { $post_ids = get_posts(array( ‘numberposts’ => -1, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)