WordPress.org

Ready to get started?Download WordPress

Forums

GD Star Rating
Multi Set Rating to one Custom Post Type Template (8 posts)

  1. nikoza
    Member
    Posted 1 year ago #

    I have created a multi rating set of and it works great if you use it with the shortcode on a custom post type.

    What I am having trouble doing is to displaying this multi rating set to the single-cpt.php of ONLY one custom post type.

    Hopefully somebody have figured that out.

    Any help will be greatly appreciated as I am stuck for days with this. Is it actually possible?

    Thank you in advance!

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

  2. gerald@WPcustoms
    Member
    Posted 1 year ago #

    you can do this with conditional tags.
    assuming your CPT is "book" use this:

    if (is_singular( 'book' ) {
      // display your rating function here
    }

    http://codex.wordpress.org/Conditional_Tags

  3. nikoza
    Member
    Posted 1 year ago #

    Thank you gerald!

    This is what I am actually looking for.
    The function, all of them failed...

    Can you please provide a sample?

    Thank you so much for trying to help.

  4. gerald@WPcustoms
    Member
    Posted 1 year ago #

    which template are you editing?

    insert this below the_content();:

    <?php
    if (is_singular( 'book' ) {
    wp_gdsr_render_multi(, 12, false, 0, 'oxygen', 20, 'oxygen_gif', 'oxygen', 20, 'oxygen_gif');
    }
    ?>

    the rating box should appear below your post on the single.php view.
    assuming you posted in a custom post type named "book"
    you can also create a page called single-book.php and use this code:

    <?php
    wp_gdsr_render_multi(, 12, false, 0, 'oxygen', 20, 'oxygen_gif', 'oxygen', 20, 'oxygen_gif');
    ?>
  5. nikoza
    Member
    Posted 1 year ago #

    thank you so much gerald. I will try that. I thought I have ended in this function before in my research but there was no documentation for this. Now that you have pointed it again I will look in the source of the plugin to configure it. Hopefully everything will be ok.

    Thank you again!

  6. gerald@WPcustoms
    Member
    Posted 1 year ago #

    don`t waste too much time with investigation in the plugin source. this plugin is really complexe and documentation is a joke.

    what you`re trying to achieve is all based on template hirarchy and/or conditional tags thus related to wordpress theme development.

    this will get you going:
    http://codex.wordpress.org/images/1/18/Template_Hierarchy.png
    my desktop background ;)

  7. DarenG
    Member
    Posted 1 year ago #

    I know this is unrelated guys but I started playing with this plugin. I think I have it working the way I want. As stated above the documentation is sparse. Can you tell me what the Multi "sets" are used for? I have multi-rating turned on but I have not created any sets. I wasn't sure how to use them.

    Is it so more then one person at the site level can review something?

  8. gerald@WPcustoms
    Member
    Posted 1 year ago #

    @DarenG:
    multi sets are used if you want to record several factors with one voting.

    i.e.
    speed: ****
    price: **
    usability: ***
    >> VOTE

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic