Advertisement
Guest User

Rating Restriction

a guest
Oct 19th, 2015
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <div class="hreview-aggregate">
  2. <span class="rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
  3. <span class="average"><?php echo get_avg_rating($post->ID); ?></span>
  4. <span class="best" itemprop="ratingValue">5</span>
  5. <span class="count" itemprop="reviewCount"><?php echo get_vote_count($post->ID); ?></span>
  6. </span>
  7. </div>
  8.  
  9. <?php
  10. if(!already_voted($post->ID))
  11. {
  12. ?>
  13. <form action="<?php echo site_url(); ?>/wp-admin/admin-ajax.php" method="post" id="rate-product">
  14. <h6><?php _e('Rate this recipe', 'FoodRecipe'); ?></h6>
  15. <p class="rates">
  16. <span class="off"></span>
  17. <span class="off"></span>
  18. <span class="off"></span>
  19. <span class="off"></span>
  20. <span class="off"></span>
  21. <input type="hidden" name="selected_rating" id="selected_rating" value="" />
  22. <input type="hidden" name="post_id" value="<?php echo $post->ID ?>" />
  23. <input type="hidden" name="action" value="rate_this" />
  24. </p>
  25. </form>
  26. <?php
  27. }
  28. else
  29. {
  30. echo '<br /><p>'. __("You have already Rated.", "FoodRecipe") .'</p>';
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement