WordPress.org

Ready to get started?Download WordPress

Forums

Post Ratings
display rating on home but not allow to change it (2 posts)

  1. radiofranky
    Member
    Posted 1 year ago #

    Hi,
    I would like to display only the rating on 'home' and allow user to rate the stars on page only. is there a way to achieve this?

    p.s also vote only one based on ip and cookie.

    Thanks very much.

    http://wordpress.org/extend/plugins/post-ratings/

  2. Alan Delval
    Member
    Posted 1 year ago #

    Use something like:

    <?php
    $rating = get_post_meta($post->ID, 'rating', true);
    $votes = get_post_meta($post->ID, 'votes', true);
    
    $votes_num = ($votes > 1) ? 'votes' : 'vote';
    ?>
    <div class=ratings>
    <ul class="rated max-rating" title="<?php echo $rating; ?> / 5">
    <li class="rating" style="width:<?php print ($rating * 16); ?>px"><span class="average"><?php echo $rating; ?></span></li>
    </ul>
    <div class="meta">
    <strong class="votes"><?php echo $votes; ?></strong> <?php echo $votes_num; ?>, <strong><?php echo $rating; ?></strong> promedio.
    </div>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.