Support » Plugin: WP-PostRatings » How to show rating of a post by post id

  • Resolved kirkward

    (@kirkward)


    Post is working on a page/post and showing rating of that page/post.

    I want to know how to show the rating of that specific post on another page.

    Is there a PHP or shortcode available>

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Thread Starter kirkward

    (@kirkward)

    Sorry. I was busy reading the other page that explained tons of usage and totally glossed over that.

    I will go hang my head in shame, and maybe think about doing 837 Hail Mary’s.

    Thread Starter kirkward

    (@kirkward)

    After hanging my head in shame, as I should, I realize I need to expand on my question.

    The php on the page you refer to is what I used to call the plugin, which I mentioned is working fine. I remember the shortcode and did not use it because I wanted to embed php in the code that did what the shortcode does. (I is an old git and my memory forgets stuff, like things I read.)

    I tried <?php if(function_exists(‘the_ratings’)) { the_ratings(1); } ?> , thinking that the parameter may go with { the_ratings) }, but it kept trying to load, so that I had to remove the php and parameter.

    Anyhoo, is there a parameter that goes with <?php if(function_exists(‘the_ratings’)) { the_ratings(); } ?> that will allow me to call the ratings of a specific page?

    Thread Starter kirkward

    (@kirkward)

    I have also tried using do_shortcode with no success. The page will not load.

    <?php $show-ratings=("[ratings id="1" results="true"]"); ?>
    <?php echo do_shortcode( $show-ratings ) ?>

    Escaping the double quotes did not help.

    Can you advise to either this problem or the php question in the prior post?

    Thanks,
    Kirk

    Thread Starter kirkward

    (@kirkward)

    Okay, once again I hang my head in shame.

    I was using double quotes in the do_shortcode function. Works fine with single quotes.
    <?php echo do_shortcode( '[ratings id="1" results="true"]' ); ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to show rating of a post by post id’ is closed to new replies.