Archived topic
Help with a plugin
25 replies · Started by Charalambos on August 8, 2019
Thats correct - delete the old one.
// means a comment - so it won't be executed in the code - you can delete that one if you want.
Tried that but it doesn't work either.
Sorry you will need to get some feedback from the developer.
Hello,
I received an answer from the plugin developer. Here it is below,
"I had a quick look at that thread, and I can guarantee you 10000% that the plugin's code works well. Of course you need to be inside the WordPress post loop to access $post, which depends on the theme's hook location. So even though the "hi" appears, if there is no valid post id, then of course the plugin can't output anything.
All you need to add is this inside a hook that has the post id available or says:
global $post;
And then below all you need is this:
if ( class_exists( 'Lets_Review_API' ) ) {
echo Lets_Review_API::lets_review_get_score_box( $post->id );
}
I have no idea why they are saying to add empty code like this though:
else {
// do nothing
}
it doesn't truly make a difference, but it's really not needed either, so just use what I put above."
There were some funky characters in the function David provided. I just edited it to remove them: https://generatepress.com/forums/topic/help-with-a-plugin/#post-979787
Can you give it another shot?
The hook is indeed inside the loop.
Thanks Tom. It works.
Now i would like to move it as a small box on the top right of the featured image, just like their demo page below. (box background color: #ff0f4f, overall rating and stars color: white)
Something as simple as that :) Tom has a good eye for this.
I just checked your site, and i can't see the review box, can you share a link where i can see that?
Hello David,
I activated the element, so you can see it now.
Try this CSS:
.generate-columns .inside-article {
position: relative;
}
.generate-columns .inside-article .lets-review-ext-5 {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
width: 90px;
height: 90px;
color: #fff;
background-color: #ff0f4f;
position: absolute;
top: 0;
right: 0;
}
Thanks David and Tom, it works perfect.
Your support is out of this world!
Awesome - we're glad to be of help.