Nombre de Rating Ar...
 
Share:
Notifications
Clear all

[Solved] Nombre de Rating Article

8 Posts
2 Users
1 Likes
382 Views
Posts: 4
Topic starter
(@marvern)
Active Member
Joined: 1 year ago

Bonjour, 

Suite à l'installation de votre plugin, est il possible d'obtenir le nombre total de personne ayant cliqué et noté avec le "Article Rating" 
 
Cas d'usage : Site de tutoriel Automobile. Nous pourrions savoir le nombre de voiture réparé en fonction du nombre de personnes ayant noté les articles. 
 
Merci d'avance, 
 
Bien cordialement 
Topic Tags
7 Replies
Asti
Posts: 6987
 Asti
Support
(@asti)
Illustrious Member
Joined: 6 years ago

Hi @marvern,

You just need to hover over the "Rating" section, you'll see the number of votes. Please watch this video: https://www.screencast.com/t/lhR2yNXRw

 

Posts: 4
Topic starter
(@marvern)
Active Member
Joined: 1 year ago

Hi @Asti, Thanks. I know but I need to know the total number of people that added a note in all the post website. 

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 6987

ok @marvern,

So please confirm that you need to display the number of ratings for all articles. 

If so, show on some screenshots where exactly you need to display the number of ratings. 

Posts: 4
Topic starter
(@marvern)
Active Member
Joined: 1 year ago

@Asti This is an exemple of application. I need to know how many people are voting on all the post. 

Exemple : 

1) Tuto How to change oil on toyota ( 15peoples voting)

2) Tuto How to change rear bulb on Peugeot 206 ( 3 peoples voting)

So 18 car fixed. 

test
3 Replies
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 6987

ok @marvern,

Thank you for he clarification. I'll ask the developers and get back to you ASAP. 

Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 6987

@marvern,

Please follow the steps below: 

1. Add this code in the functions.php file of the active theme:

add_shortcode('wpdiscuz_all_ratings', 'wpdiscuz_get_all_ratings');
function wpdiscuz_get_all_ratings(){
    global $wpdb;
    $ratings_count = (int)$wpdb->get_var("SELECT COUNT(*) FROM `{$wpdb->prefix}wc_users_rated`");
    echo 'Ratings Count - ' . $ratings_count;
}

2. Then use the following shortcode to display the total number of ratings for all articles: 

[wpdiscuz_all_ratings]
(@marvern)
Joined: 1 year ago

Active Member
Posts: 4

@asti Thanks you asti. I will try to implement it 🙂

Share: