WordPress.org

Ready to get started?Download WordPress

Forums

Five Star Rating
[resolved] Truncated posts (4 posts)

  1. MKachtan
    Member
    Posted 2 years ago #

    Is there a way to show the star rating on truncated posts? For example, my theme truncates a post over X amount of characters and then displays a Read More link. When a truncated post has the shortcode for Five Star Rating it is shown as asterisks.

    What do I need to modify to change this behavior?

    http://wordpress.org/extend/plugins/five-star-rating/

  2. andrew.alba
    Member
    Plugin Author

    Posted 2 years ago #

    You can do that, but the down side of doing this is that the ratings will show up on all pages that you insert the code on.

    What I usually do is create a copy of Page (page.php) and rename it rating_page.php and change name of template to Rating Page. In it you can insert the code below (it is in the FAQ) where you want the ratings to appear all the time.

    <?php echo five_star_rating_func('star'); ?>

    Once you save the changes, you will see the ratings appear on every post that uses that page.

  3. MKachtan
    Member
    Posted 2 years ago #

    Thank you for the quick reply.

    I have created a post template with the code in it and it's working great, however the Five Star Rating stars don't appear in the truncated posts which are being displayed on the page, they only appear when going to the post itself.

    Here is an example:
    http://www.thesnowtour.com/?page_id=661

    That page is set to display a widget, that widget is set to show only posts from a certain category (in this case it's "user submitted content"). I would like for every post displayed via the widget on that page to display the voteable stars without the user having to click into the post to vote.

    Again thank you very much for taking the time.

  4. andrew.alba
    Member
    Plugin Author

    Posted 2 years ago #

    sorry I missed your post back. My only suggestion is to double check where you put the code. It has to be outside of The Loop.

    From your description it sounds like your code is in the loop.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic