WordPress.org

Ready to get started?Download WordPress

Forums

PollDaddy Thumbs up / Thumbs down code / plugin (2 posts)

  1. thehalogod
    Member
    Posted 4 years ago #

    PollDaddy offers a free rating code thing that works in WordPress and the support documentation can be found here:

    http://support.polldaddy.com/rating-widget/

    So based on that support doc, I created my rating code from within my polldaddy account (found here):

    http://polldaddy.com/ratings/list-ratings.php

    This is the code I ended up with from creating my rating code and then modifying it based on the first URL I supplied above so that it would work with all posts on my blog and not just one:

    <div id="pd_rating_holder_810655"></div>
    <script language="javascript" type="text/javascript">
    PDRTJS_settings_810655 = {
        "id" : "810655",
    "unique_id" : "wp-post-<?php echo( $post->ID ); ?>",
    "title" : "<?php echo( $post->post_title ); ?>",
    "permalink" : "<?php echo( get_permalink( $post->ID ) ); ?>"
    };
    </script>
    <script type="text/javascript" language="javascript" src="http://i.polldaddy.com/ratings/rating.js"></script>

    But for some reason it's not displaying correctly on my site. Does anyone have experience with this nero rating code as they call it?

    Here is an example of a site using it exactly how I want to:

    http://wedinator.com/

    Advice?

  2. ibast
    Member
    Posted 4 years ago #

    I had the same problem, but I got it working when I changed the div id:s to be unique.
    The following code should work in your case, you can put it both in the loop (index.php) and on the individual page (single.php):

    <div id="pd_rating_holder_810655_<?php echo( $post->ID ); ?>"></div>
    <script type="text/javascript">
    PDRTJS_settings_810655_<?php echo( $post->ID ); ?> = {
    	"id" : "810655",
    	"unique_id" : "wp-post-<?php echo( $post->ID ); ?>",
    	"title" : "<?php echo( $post->post_title ); ?>",
    	"permalink" : "<?php echo( get_permalink( $post->ID ) ); ?>",
            "item_id" :  "_<?php echo( $post->ID ); ?>"
    };
    </script>

    And somewhere in the footer you can put

    <script type="text/javascript" language="javascript" src="http://i.polldaddy.com/ratings/rating.js"></script>

    Good luck!

Topic Closed

This topic has been closed to new replies.

About this Topic