• Resolved taadike

    (@taadike)


    Hello,

    Somewhy this code displays the ratings above the post:
    <?php if(function_exists(‘the_ratings’)) { the_ratings(); } ?>

    But I want to automatically display the ratings BELOW the post. I have tried everything I could but still no luck. Seems like it doesn’t matter where I stick that piece of code, it always displays it above the post.

    https://wordpress.org/plugins/wp-postratings/

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

    (@gamerz)

    Check with your theme author. It differs from theme to theme on where to place the code.

    Thread Starter taadike

    (@taadike)

    I am using twentythirteen theme.
    I wrote this code in the functions.php

    add_filter( 'the_content', 'ratingss' );
    function ratingss( $content ) {
        if ( is_single() && function_exists('the_ratings') ) {
    $content = $content . the_ratings();
    }
        return $content;
    }

    Somewhy it displays the ratings before the post, not after.

    If I write some text into it such as $content = $content . the_ratings() . sometext;
    then the text does appear after the content but the ratings still appear before the content.
    What can possibly be wrong?

    Plugin Author Lester Chan

    (@gamerz)

    Try

    $content = $content . the_ratings( 'div', get_the_ID(), false );

    Thread Starter taadike

    (@taadike)

    Thanks! That fixed it!
    You’re the man.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display rating below the post, not above’ is closed to new replies.