WordPress.org

Ready to get started?Download WordPress

Forums

Rating-Widget
[resolved] My theme doesn't use the_excerpt() (8 posts)

  1. Wizd3m
    Member
    Posted 6 months ago #

    Hello,

    I could really use some help with this (awesome) plugin on my themasterfoundry.com website.

    Basically, all I want is for the ratings to display on my front page post excerpts. Sadly, my theme (Gamepress) uses gamepress_excerpt for PHP code, rather than the apparently needed the_excerpt(). As a test, I renamed the prior to the latter in my theme php file responsible for excerpts, and the ratings appeared. Sadly, the excerpt itself became all out of whack, so I changed everything back to default.

    Is there anything that can be done to keep my current excerpt layouts AND have the ratings appear?

    Furthermore, my actual desire is to have the ratings appear in the excerpt headings (where the title of post is) rather than in the actual content box. I've managed to do that as well by simply adding <?php rw_the_post_rating($post->ID); ?> into that same theme php file responsible for excerpts. This way, I keep my excerpt alignment AND get the rating exactly where I want. BUT, now the ratings show for every single post on the front page, even those that shouldn't have it.

    I feel like I'm so close to finding a solution, could someone please suggest something?

    Thank you very much for taking the time to read all of this.

    Anton

    http://wordpress.org/plugins/rating-widget/

  2. RatingWidget
    Member
    Plugin Contributor

    Posted 6 months ago #

    Seems like you are almost :) When you say "now the ratings show for every single post on the front page", what filtering do you use to prevent from ratings to show on specific posts? Is it by category? By post id?

  3. Wizd3m
    Member
    Posted 6 months ago #

    Thank you for answering!

    I have "all categories" selected, and have added a few exceptions based on ID. So yea, I'm filtering by post ID.

  4. RatingWidget
    Member
    Plugin Contributor

    Posted 6 months ago #

    Apologies for the late response, try to do the following:

    1. Open the main plugin's file, rating-widget.php, and make the method rw_validate_visibility public.
    2. Now, instead of the code you've previously added. Try to use this:
      <?php
          if (ratingwidget()->rw_validate_visibility($post->ID, 'blog-post'))
              rw_the_post_rating($post->ID);
      ?>

    Let me know if it worked.

  5. Wizd3m
    Member
    Posted 6 months ago #

    No worries, thank you for getting back to me.

    As far as making the method rw_validate_visibility public, I'm sadly unsure of how that is done. I'm not very knowledgeable when it comes to PHP and mostly rely on trial and error to learn. Could you please explain?

    Nevertheless, I still added the code you provided, just as I did before, and it worked! Posts where ratings are unneeded are now being skipped! The rest show on the front blog page as desired, take a look: http://themasterfoundry.com/

    Should I still worry about rw_validate_visibility?

  6. RatingWidget
    Member
    Plugin Contributor

    Posted 6 months ago #

    Awesome! I'm happy it worked. And it looks great on your blog. No need to worry about rw_validate_visibility.

    Btw. I would really appreciate if you could spend 60 sec rating the plugin on WP to help us spread the word (don't forget to click the Post button to submit the rating):
    http://wordpress.org/support/view/plugin-reviews/rating-widget#postform

  7. Wizd3m
    Member
    Posted 6 months ago #

    Of course, and done :)

    Thank you for all your help, and your awesome plugin. I've been wanting to have the stars appear on the front page for some time, and am soo happy to finally have it working and looking the way I was hoping.

    Thanks for you patience.

    Anton

  8. vovafeldman
    Member
    Plugin Author

    Posted 6 months ago #

    Thanks :)

Reply

You must log in to post.

About this Plugin

About this Topic