WordPress.org

Ready to get started?Download WordPress

Forums

Rating-Widget: Star Rating System
[resolved] Show Rating (7 posts)

  1. misterco
    Member
    Posted 1 year ago #

    Hello,

    I want to know if there is a shortcode or php function to print post rating where I want?

    For example on my front page I can't see rating with plugin option (also with "show on exerpt" option), and I want to manualy put a php code on my index.php to show post rating.

    Thanks for your help and for your wonderful plugin!!

    Olivier

    http://wordpress.org/extend/plugins/rating-widget/

  2. vovafeldman
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @misterco,

    First of all, if you can't see the ratings on your front page while it's enabled - there is some issue with your theme. Make sure your front pages are using the_excerpt hook to print the excerpts.

    Please let me know if that worked.

    With regards to the short code, since we got so much requests for a shortcode, our next release will have it :)

  3. misterco
    Member
    Posted 1 year ago #

    Thanks for your quick response!

    I think my theme (Nublu) is the problem, my front page is using a theme function limit2 to print excerpt :

    function limits2($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    $content = strip_tags($content, '');

    if (strlen($_GET['p']) > 0) {
    echo $content;
    }
    else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
    $content = substr($content, 0, $espacio);
    $content = $content;
    echo $content;

    echo "...";
    }
    else {
    echo $content;
    }

  4. misterco
    Member
    Posted 1 year ago #

    It is possible to call rating function manually?

  5. misterco
    Member
    Posted 1 year ago #

    It's ok for me, I just replace limit2 function by excerpt and it's works!!

    Your can close this ticket.

    PS : I have rated (five star :P) and comment your plugin ;)

  6. vovafeldman
    Member
    Plugin Author

    Posted 1 year ago #

    Great, happy it was resolved! and thanks for the vote up.

  7. miseva
    Member
    Posted 1 year ago #

    hi my template already has a rating system, but i want to change it with this widget, so i activated this plugin and it works, but i want to change something here:

    1. my site: http://hotels.myjournal.ge/?place=asdasdasdas as you see rating is in the middle of post, i want some code to replace it in place detail sidebar (right corner of site) where i already have a ratings.

    `<?php if(get_option('ptthemes_disable_rating') == 'no') { ?>
    <p> <span class="i_rating"><?php echo RATING." :aa"; ?></span>
    <span class="single_rating">
    <?php echo get_post_rating_star($post->ID); ?>
    </span>
    </p><?php } ?>`

    here is the code and i want some code of this plugin to replace it with it.\

    2. i want to show ratings in index page: http://hotels.myjournal.ge/
    you see there is ratings at index page, and code to show this is:

    <?php if($my_post_type != 'post' && get_option('ptthemes_disable_rating') == 'no') { ?><span class="rating"><?php echo get_post_rating_star($post->ID);?></span> <?php } ?>

    i need some code of this plugin to replace it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.