Storing and using Cat ID (1 post)

  1. liaaz
    Posted 5 years ago #

    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
    can anyone have a look that what is wrong ?

    <?php function getCurrentCatID(){
      global $wp_query;
      if(is_category() || is_single()){
    $cat_ID = get_query_var('cat');
      return $cat_id;
    <?php if (function_exists('get_highest_rated_category')): ?>
          <?php get_highest_rated_category($cat_id); ?>
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.