Help me to use the plugin "WP-PostRatings" in Graphene theme

  • LuboUzunov

    #5545

    Hi,

    I need a little help to install “WP-PostRatings” plugin in Graphene theme.

    When I install and activate this plugin I must to place this code somewhere:

    You may place it in archive.php, single.php, post.php or page.php also.
    Find: <?php while (have_posts()) : the_post(); ?>
    Add Anywhere Below It (The Place You Want The Ratings To Show): <?php if(function_exists('the_ratings')) { the_ratings(); } ?>

    In my old theme was in single.php, but in this theme I don’t know where.

    I want to shows up the ratings after the post/text (before the line and tags and social buttons /look the demo of your theme/), but I can’t find in which php page is this. Pls tell me where to put this code in Graphene 🙂

    Thank you!

    Lubo Uzunov

    Anonymous

    #32190

    Actually using “WP-PostRatings” plugin in Graphene is even easier. No need to edit any theme file. Just use Action Hook widgets.

    Go to Graphene Options –> Advanced –> Action Hooks Widget Areas and select graphene_before_post_content or any other appropriate action hook in loop-single.php. Then go to Appearance –> Widgets and drag a Text Widget to Graphene Before Post Content widget area and add [ratings] to it. That’s it! You can also use a PHP Widget with this function,

    <?php
    if(function_exists('the_ratings')) { the_ratings(); }
    ?>

    LuboUzunov

    #32191
    Quote:
    Actually using “WP-PostRatings” plugin in Graphene is even easier. No need to edit any theme file. Just use Action Hook widgets.

    Go to Graphene Options –> Advanced –> Action Hooks Widget Areas and select graphene_before_post_content or any other appropriate action hook in loop-single.php. Then go to Appearance –> Widgets and drag a Text Widget to Graphene Before Post Content widget area and add [ratings] to it. That’s it! You can also use a PHP Widget with this function,

    <?php

    if(function_exists(‘the_ratings’)) { the_ratings(); }

    ?>

    One more stupid question:

    Where exactly to put this function?

    When I add [ratings] in Text Widget it shows literally “[ratings]” in the blog 😀 And if I put the function there i’ts show me nothing… I don’t get it …yet 🙂

    And with PHP Widget it doesn’t work. The stars are inactive…

    Anonymous

    #32192

    Do you have a child theme? If yes, try adding this code to your child theme’s functions.php file,

    <?php
    function graphene_show_the_ratings {
    if ( function_exists('the_ratings') ) {
    the_ratings();
    }
    }

    add_action('graphene_before_post_content', 'graphene_show_the_ratings');
    ?>

    LuboUzunov

    #32193

    No. I don’t have a child theme 🙂

    Anonymous

    #32194
    Quote:
    No. I don’t have a child theme 🙂

    Get it here – http://www.prasannasp.net/graphene-child-theme-template/

    LuboUzunov

    #32195

    When I add this:

    Quote:
    <?php function graphene_show_the_ratings { if ( function_exists(‘the_ratings’) ) { the_ratings(); } } add_action(‘graphene_before_post_content’, ‘graphene_show_the_ratings’); ?>

    The result is:

    Parse error: syntax error, unexpected '{', expecting '(' in C:xampphtdocswordpresswp-contentthemesgraphene-childfunctions.php on line 2

    Anonymous

    #32196

    Oh! My bad. Here is the correct code,

    <?php
    function graphene_show_the_ratings() {
    if ( function_exists('the_ratings') ) { the_ratings(); }
    }
    add_action('graphene_before_post_content', 'graphene_show_the_ratings');
    ?>

    LuboUzunov

    #32197

    Ok, it’s works. But the stars are separated with space between them and with grey border.

    Screen1

    And the ratings are shows up in the top of the post and I want to shows after the post/text. 🙂

    Screen2

    LuboUzunov

    #32198

    Also when I vote:

    Warning: Creating default object from empty value in C:xampphtdocswordpresswp-contentpluginswp-postratingswp-postratings.php on line 183

    this is the wp-postratings.php.

Viewing 10 posts - 1 through 10 (of 12 total)

  • 1
  • 2
  • You must be logged in to reply to this topic.