WordPress.org

Ready to get started?Download WordPress

Forums

GD Star Rating
[resolved] how to restrict on which posts the ratings appear in RSS feeds (11 posts)

  1. Ovidiu
    Member
    Posted 2 years ago #

    there is an option that does this: "Add ratings to posts in RSS feeds."

    Unfortunately, that shows ratings for all items in my feed.

    I'd like to be able to select where the ratings show up, either by category, or by post_type or maybe even show the ratings in the feed only if a post has ratings?
    I think its quite annoying showing 0 out of 0 stars underneath some unrated posts.

    Unfortunately, the author seems to not answer here as he offers paid support on his own support forum, which is understandable, so does anyone using this plugin have some hints how I can get this done?

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

  2. azn137
    Member
    Posted 2 years ago #

    Yeah, I'd started a thread regarding restricting the rating to appear for only certain posts, no dice.

    http://wordpress.org/support/topic/plugin-gd-star-rating-limit-plugin-to-only-single-post

  3. Ovidiu
    Member
    Posted 2 years ago #

    yeah, sucks.
    the author only provides support in his paid forum and the tutorials/how-tos don't even touch this subject.

    What have you found out so far?

    Do you know where the function is located that injects the ratings into the feeds?

  4. azn137
    Member
    Posted 2 years ago #

    In version 1.9.16, check class.php, line 902. That might be a good hint.

  5. Ovidiu
    Member
    Posted 2 years ago #

    ok, I found your thread, checked class.php and changed this code:

    /**
         * WordPress rss content filter
         */
        function rss_filter($content) {
            if (is_feed()) {
                if ($this->o["rss_active"] == 1) $content.= "<br />".$this->f->render_article_rss();
                if ($this->o["integrate_rss_powered"] == 1) $content.= "<br />".$this->powered_by();
                $content.= "<br />";
            }
            return $content;
        }

    into this:

    /**
         * WordPress rss content filter
         */
        function rss_filter($content) {
                    if ((is_feed())&&(!in_category('4'))) {
                if ($this->o["rss_active"] == 1) $content.= "<br />".$this->f->render_article_rss();
                if ($this->o["integrate_rss_powered"] == 1) $content.= "<br />".$this->powered_by();
                $content.= "<br />";
            }
            return $content;
        }

    That worked for me as I didn't want ratings for category ID 4.

    What exactly do you want to do? Let me know and I can help you now that I found the proper location to edit :-)

  6. azn137
    Member
    Posted 2 years ago #

    I'm trying to figure out to only load the script (and the CSS) for only single post. I tried insert this line:
    if (!is_single() || !is_admin()) return;
    in a few places, but that seems to bork things. For example, line 1770, right below the function definition.
    function include_rating_css($external = true, $return = false) {
    By the way, I can't see your post here. I've only got the notifications via emails.

  7. Ovidiu
    Member
    Posted 2 years ago #

    sorry, but I think you are mixing up a few things.
    I am talking about showing the ratings in the feed.

    You want to restrict where they are shown on your blog.
    I had a look at line 1770 you mentioned but that is just for including the rating CSS as far as I can see...

    If you find the right function that inserts the ratings I am sure I can help you modify it...

    These options aren't enough? Just checking :-) http://screencast.com/t/4uc6ZV8B7a

  8. azn137
    Member
    Posted 2 years ago #

    We're really not talking about the same thing. I don't want the Javascript and the CSS file to be loaded anywhere besides the admin area or on a single post. I'm fine tuning the performance, and these files are just too big.

    Thanks for trying though :)

  9. Ovidiu
    Member
    Posted 2 years ago #

    Ah, I get it.
    Well, please update this thread if you manage to find out.
    I haven't hit the optimization stage yet :-)
    Still twiddling with the design...

    you see, when you said:

    Yeah, I'd started a thread regarding restricting the rating to appear for only certain posts, no dice.
    I took it literally, meaning I thought you wanted to restrict where the ratings appear not where the scripts are being loaded.

  10. azn137
    Member
    Posted 2 years ago #

    For some reason I can't see your post, so it looks like I'm talking to myself...

    http://i.imgur.com/oxpoI.png

  11. Ovidiu
    Member
    Posted 2 years ago #

    That happens every now and then...

    I get marked as a spammer by Akismet and then I have to mail to the automattic mailing list to get unspammed :-(

    quite annoying.
    I think they call it a bozo user, meaning I usually talk alone and nobody answers and ignores my posts but since they introduced the email subscription that doesn't work anymore. At least now someone like you could let me know that I am bozoed again!

    Many thanks for telling me!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic