First user fill this custom comment form. This is my meta_key i want that i want to fetch. for every comment there are 10 rating. I want to make below rating filter.But don't know how to start. This is what i tried yet. add_action( 'comment_post', 'show_message_function', 10, 2 ); function show_message_function( $comment_ID, $comment_approved ) { $comment = get_comment( $comment_ID ); if( empty($comment) ) { return; } $post = get_post( $comment->comment_post_ID ); $post_comments = get_comments( ['post_ID' => $post->ID ] ); $meta_value …
I collect reviews from different websites and I would like to be able to add them manually to my products in woocommerce, how can I add the star rating from the back office over the text? in the comment there is no metabox of the choice. I searched for this information and the only document found is this woocommerce report in the issue sections: https://github.com/woocommerce/woocommerce/issues/25656 can you help me understand how to add the rating change from the backoffice on …
I am trying to create a multi criteria post rating function with simple form and post_meta and user meta. The Goal when users submits their ratings 2 things should happen: 1.the ratings is stored in the post_meta called 'wpd_rating' like this: array(user id => array( field1 => 5 field2 => 3 field3 => 4 ), another user id => array( field1 => 2 field2 => 5 field3 => 4 ) ) 2.the ratings is stored in the user_meta called 'plgn_rating' …
How do I display a rating at all times, even if it is empty? This is for woocommerce, meant for product boxes like popular products and new products, doesn't have to show up on single product pages.
I'm trying to add ld+json schema markup to each recipe page on my site that will automatically pull over the most up to date aggregator rating data (from kk star ratings). I came across this post (https://wordpress.stackexchange.com/questions/368872/show-the-ratingvalue-and-ratingcount-values-of-kk-star-ratings-plugin) which has the below code: <?php //Getter methods //this will return the base best score like 5 or 10. function get_best_rating(){ return max((int) get_option('kksr_stars'), 1); } //This will return the rating vote count function get_rating_count($id){ return count_filter(null, $id, null); } //This will return …
I have a bilingual site. Previously I was using a language plugin that would store the different languages in the same post which means all my comments belonged to that post. I switched to WPML which manages 1 post per language. In my migration process, I therefore ended up with twice as many posts since the migration tool essentially read each post, took the second language from the post and created a new post with it. Previously one post, 2 …
On my WooCommerce site I am trying to output the star rating for a product that is reviewed. Instead, it outputs this: Rated 3.38 out of 5 based on 8 customer ratings What am I missing with the following code? $rating_count = $product->get_rating_count(); $review_count = $product->get_review_count(); $average = $product->get_average_rating(); echo wc_get_rating_html( $average, $rating_count ); When I switch from my custom theme to default WordPress theme, the ratings then show.
I want to display the "ratingValue" and "ratingCount" values generated by the KK Star Ratings plugin (Github). I made a JSON-LD SoftwareAplication and here is the code I use in function.php: add_action('wp_head', 'add_jsonld_head', 1); function add_jsonld_head() { if ( is_single() ) { ?> <script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "SoftwareApplication", "@id": "<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>", "softwareVersion": "<?php the_field('versi_terbaru'); ?>", "operatingSystem": "Windows", "applicationCategory": "<?php the_field('kategori'); ?>", "dateModified": "<?php the_modified_time('c'); ?>", "name": "<?php the_title(); ?>", "aggregateRating": { "@type": …
I'm working on wordpress and I want to order my post by rating. I'm new with it, and I need some help. I tried many things, but seem it's not working :/ My Wordpress Custom field which contain the numerical value (rating) is : geekmag_cmb2_general_review I have heard about WP Query but don't understand how it works/use it and where should I write the WP_Query :( Sorry if it seam easy to you, but I really want to understand how …
I found a rating system that users can rate the post when commenting. Every thing is good but I want to use the average rating of posts to sort them to users based on average rating (in fact be able to query). I don't know how I can do that??? The rating_key and rating_value will be saved in wp_commentmeta table but I want to save the average rating value of every post in wp_postmeta to be able to query posts …
I want to have a rating and review system for custom post type. This is the method i am thinking of ->Create a custom post type ->Create meta fields ->Create a form to post reviews front end. But how can i link the custom post type page and review together? Another method i am thinking of is to tweak comments . But all the reviews will get added up in the WordPress comment menu in backend Looking to best method …
I'm using Woocommerce and I'm trying to get the total for each star rating using the post id (just like in the image below). Each rating is stored on my database as a number from 1 - 5 I just don't know how to go about retrieving the total count for each rating. Any help will be greatly appreciated.
I have a mult-author site where the author page gets high traffic. People want to know more about them. I have modified the author page to show more info, some custom fields, etc. but what I'd really like to do is turn on Comments for the author.php page (so that OTHER logged in users can leave review-like messages for the Author), and ultimately offer a star-ratings type of effect so that Users can "rate" the author. I have searched for …
i have a rating system in comments, for each comment user can rate 1-5 Stars. Now , i want the average of all ratings in comments of that post to show. How can i do that. Here is the link to the code file related to My rating System. Current Users can rate and comment. But i want the average of all comment ratings in that post. And this is a custom Post type. check this link for the code …
I'm trying to do a simple if function on my code but for some reason it just isn't working correctly. I've gone over it several times to see if there is anything I'm missing, but no luck. I'm trying to say my value is 0 then echo nothing if not else the_ratings. Very simple... <?php if( get_post_meta( $post_id, 'ratings_users', true ) === '0' ) { }else{ the_ratings(); } ?> <?php if(!get_post_meta( $post_id, 'ratings_users', true ) !='0' ) { }else{ the_ratings(); …
I've been researching this for a few days now and found many voting plugins - unfortunately none of them does exactly what I need, so I am trying to hack some functions/scripts that I've found by searching online. I'm working with this script, now: http://bavotasan.com/2011/a-better-voting-system-for-wordpress/ I'm trying to figure out a way to only allow the IP to vote once on the website. Essentially, if they vote on one post - they cannot vote on another. This post is similar …
Does anyone know how to automatically sort posts by Vote Count? I am using a plugin called WP Voting where a visitor can vote on a post. The plugin keeps track of how many votes each post has. The author offered some code that would sort them posts in the main blog page and it works, but it unfortunately broke the Category view. The code is below and it is dropped into the functions.php /** * SORTS THE POSTS BY …
Basically I'm trying to make it so that all pending posts can be voted on if the user is logged in. once it gets to 10+ votes it will become published. OK so no longer using database connections and now using Meta Keys, therefore the code has been changed to show what I now have <?php //if the post is pending show if(get_post_status() == 'pending') { //added a post_vote to the wp_posts database for use later //if the user is …
I have a post voting system that stores and displays the vote as an integer. When someone clicks on plus the vote increases by 1, when minus - decreases by 1 (exactly the same way as on this website). The problem is that the votes are cookies-based, so when these are refreshed the user can vote again. I would like to limit this to just one vote per user. Now I would like to ask for advice regarding the database …