wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

How to manually insert a rating into a template via PHP?


NeXan
Posts: 2
Topic starter
(@nexan)
New Member
Joined: 10 months ago

Hello, I want to insert a rating in the header next to the title in the template. Tell me, is there a PHP function for inserting a rating? For example:

<header>
<h1>
<?php the_title(); ?>
</h1>
<div id="placeratings">
<?php getPostRatingHtml(); ?>
</div>
</header>

This function does not work.

3 Replies
Asti
Posts: 3567
 Asti
Support
(@asti)
Support member
Joined: 4 years ago

@nexan,

Could you please clarify a bit? What type of rating do you mean? 

Thre are two types of ratings: 

In the case of the last one, you can use the  shortcode.

In the case of the first one, you'll need to do some manipulations and get the data from the DB tables. If you're familiar with DB structure let us know. We'll tell you where the data are stored. 

Reply
1 Reply
mihaisandman
(@mihaisandman)
Joined: 9 months ago

New Member
Posts: 1

@asti, hello. Could you please help me out with what needs to be done to get the rating values for each post from the DB?

cheers, 

Mihai

Reply
fred
Posts: 1
 fred
(@fred)
New Member
Joined: 9 months ago

Hello, could you help us with the function for :

we would like to display the rating in the article preview

Thank you for your feedback

Reply
Share: