• Resolved clublakers

    (@clublakers)


    My goal here is to have a list of highest rated posts appear in the sidebar — but only those posts that are relative to the category that is being browsed.

    Here is the code to show the highest rated reviews for category 3:

    <?php if (function_exists(‘get_highest_rated_category’)): ?>

      <?php get_highest_rated_category(3, ‘both’, 10); ?>

    <?php endif; ?>

    Is it possible to apply a cat ID template tag to the first “3” variable so the ratings category will default only to the category that is being viewed?

    Otherwise I can create a bunch of custom category pages (ie category-3.php, category-4.php, etc) with custom sidebars — but that seems like overkill.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • u may want to try
    <?php if (function_exists(‘get_highest_rated_category’)): ?>

    <?php get_highest_rated_category(get_query_var(‘cat’), ‘both’, 10); ?>

    <?php endif; ?>

    Thread Starter clublakers

    (@clublakers)

    Ah, thanks gamerz! I misunderstood the purpose of that function.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WP-PostRatings Auto Category?’ is closed to new replies.