WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings
Get highest rated post (2 posts)

  1. dpcds
    Member
    Posted 1 year ago #

    Hello,

    i am a little new to php and WordPress ;(

    i am trying to get the highest rated post on a page but it cant get it to work hope someone can help me out here is my code but i dont think that its good ?

    <?php
    			$args = array( 'numberposts' => -1, 'orderby' => 'desc', 'sortby' => 'highest_rated',  );
    			$postslist = get_posts( $args );
    			foreach ($postslist as $post) :  setup_postdata($post); ?>
    			    <div>
    			            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    			              <br />
    			            <?php the_date(); ?>
    			            <br />
    			          <?php the_excerpt(); ?>
    			   </div>
    			<?php endforeach; ?>

    Greetings

    http://wordpress.org/extend/plugins/wp-postratings/

  2. kevin heath
    Member
    Posted 1 year ago #

    Hi

    take a look at some of your args which are not correct for the plugin.

    Here's a bit of help

    $args = array(
    
    'r_sortby' => 'highest_rated',
    'r_orderby' => 'desc',
    )

    Kevin

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic