0

I've installed WP-PostRatings plugin It is to set up but I am trying to add it to the theme. In plugin template there is such code: I have tried to add these code so <php echo " These code here" ?> but it doesn't show. If I need to insert in comment php. How can I generate code for PHP loop? Not shortcode

enter image description here

But in Admin panel it shows me ratings: enter image description here

  • You may get an answer here; but all plugins in the wordpress.org catalogue have their own support forums; in this case: wordpress.org/support/plugin/wp-postratings some plugins' forums provide excellent support others may not. – scytale Jan 15 '18 at 11:46
0

If you, for some reason, don't want to use the shortcode ([ratings]), you can always use the_ratings() directly in your template.

Make sure you are within the loop so it'll be able to identify the correct post ID for you.

If you want to use it outside the loop, you can pass your ID manually. The function's signature is

function the_ratings($start_tag = 'div', $custom_id = 0, $display = true) {

so you could call it as

the_ratings("div", 123)

if you wanted to output the ratings for the post with the ID 123.

0

To print a shortcode in your own code you need to use the do_shortcode() function, eg: echo do_shortcode('[ratings id="1" results="true"]');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.