Help me to use the plugin "WP-PostRatings" in Graphene theme
-
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
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(); }
?>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…
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');
?>No. I don’t have a child theme 🙂
Quote:No. I don’t have a child theme 🙂Get it here – http://www.prasannasp.net/graphene-child-theme-template/
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
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');
?>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.