I am trying to display the top rated posts from a category, for that I need to pass the cat-id variable to wp-postratings
here is what i have done, but it isnt working, I suspect some problem with the code
is the cat_id being correctly saved and passed to get_highest_rated_category function
<?php function getCurrentCatID(){
global $wp_query;
if(is_category() || is_single()){
$cat_ID = get_query_var(‘cat’);
}
return $cat_id;
}
OK
I also want the above to work on the post pages, for that I need to get the cat -d from the category slug
and than run the above
however, I am not sure about the if else if correct syntax in php
here is what I have , can someone look and tell what’s wrong?