WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
[resolved] Showing highest-rated (excerpt only) (12 posts)

  1. chazzbro
    Member
    Posted 2 weeks ago #

    The posts on my blogs have no title. So I would like to display the highest-rated posts in a sidebar widget by showing (maybe 40 characters of) an excerpt instead of the post title. How would I accomplish this?

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

  2. Lester Chan
    Member
    Plugin Author

    Posted 2 weeks ago #

    WP-Admin -> Ratings -> Ratings Template. use %POST_EXCERPT%

  3. chazzbro
    Member
    Posted 2 weeks ago #

    I had seen the templates, but am unclear how to use them.

    I replaced title with excerpt here, but this code isn't working properly in either a page or text widget:

  4. %POST_EXCERPT% (%RATINGS_SCORE% rating, %RATINGS_USERS% votes)
  5. Can you tell me what I'm missing?

  • chazzbro
    Member
    Posted 2 weeks ago #

    Trying this again:

  • %POST_EXCERPT% (%RATINGS_SCORE% rating, %RATINGS_USERS% votes)
  • chazzbro
    Member
    Posted 2 weeks ago #

    sorry...i replaced both instances of post_title with post excerpt in the highest-rated template. but it doesn't seem to work in either a text widget or even a page.

    i don't understand how to use the templates.

  • Lester Chan
    Member
    Plugin Author

    Posted 2 weeks ago #

    Hmm, Change the template for "Highest Rated" and "Most Rated"

    I changed mine to <li><a href="%POST_URL%" title="%POST_EXCERPT%">%POST_EXCERPT%</a> %RATINGS_IMAGES% (%RATINGS_AVERAGE% out of %RATINGS_MAX% with a score of %RATINGS_SCORE%)</li>

    http://lesterchan.net/wordpress_dev/ (left sidebar) it works for me.

  • chazzbro
    Member
    Posted 2 weeks ago #

    Ah, yes...now I am understanding better.

    One further question: Is there a way to limit the excerpts to a certain number of words or characters?

    thx,
    c-

  • Lester Chan
    Member
    Plugin Author

    Posted 2 weeks ago #

    Nope, you have to modify the plugin yourself to achieve that ratings_post_excerpt() -https://github.com/lesterchan/wp-postratings/blob/master/wp-postratings.php#L524

    There is no built-in feature for that.

  • chazzbro
    Member
    Posted 1 week ago #

    Thanks for your help on this so far. I have switched to a new WP theme and it does have a widgetized sidebar. Is it possible to display the Highest Rated posts as the widget would, but just using some code instead that I can drop in manually?

  • Lester Chan
    Member
    Plugin Author

    Posted 1 week ago #

    Sorry I don't get what you mean.

  • chazzbro
    Member
    Posted 1 week ago #

    I can't use widgets in the WordPress theme I'm using for a particular site. I was wondering if there was code I could paste into the sidebar instead that would replicate the output of the plugin.

  • Lester Chan
    Member
    Plugin Author

    Posted 1 week ago #

    Yeap all the code are stated in https://wordpress.org/plugins/wp-postratings/faq/

  • Reply

    You must log in to post.

    About this Plugin

    About this Topic

    Tags

    No tags yet.