WordPress.org

Ready to get started?Download WordPress

Forums

Storing and using Cat ID (1 post)

  1. liaaz
    Member
    Posted 4 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')): ?>
       <ul>
          <?php get_highest_rated_category($cat_id); ?>
       </ul>
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.