• Resolved quicklyreviewus

    (@quicklyreviewus)


    Is there a custom field I can use to sort the post loop by votes? In the below example ‘meta_key’ would be the custom field. Thanks.

    $posts = get_posts(array(
    	'post_type'			=> 'post',
    	'posts_per_page'	        => -1,
    	'meta_key'			=> 'votes',
    	'orderby'			=> 'meta_value',
    	'order'				=> 'DESC'
    ));
Viewing 1 replies (of 1 total)
  • Plugin Author aheadzen

    (@aheadzen)

    you can use do_shortcode(‘[voter_plugin_top_voted type=post num=5]’); if you don’t want html, perhaps you could look into code for this shortcode and figure out what you want to achieve?

Viewing 1 replies (of 1 total)
  • The topic ‘Sorting Post Loop By Votes’ is closed to new replies.