check yasr existence and get number/sum of votes

[ad_1]

Hi,

Inside my single.php I used to use the method YasrDatabaseRatings::getVisitorVotes in order to:
1) Check if YASR is active
2) Get number and sum of votes

The code was something like:
if(class_exists(‘YasrDatabaseRatings’))
{
$votes = YasrDatabaseRatings::getVisitorVotes();
$number = $votes[‘number_of_votes’];
$sum = $votes[‘sum_votes’];
}

For some time now this code no longer works (the condition returns false).

Maybe the methods have changed?

How do I perform functions 1 and 2 above?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer