The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
How to manually ins...
 
Share:
Notifications
Clear all

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

4 Posts
4 Users
0 Reactions
1,310 Views
Posts: 1
Topic starter
(@nexan)
New Member
Joined: 4 years 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: 7661
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 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 [wpdrating] 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)
Joined: 4 years 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
Posts: 1
 fred
(@fred)
New Member
Joined: 4 years 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: