I have a table in my database containing vote a tally I'm trying to order posts by.
screenshot: the table
I've tried something like this, which brings up all the voted posts and pagination okay but does not order them by DESC. Any advice if I'm approaching this right is appreciated.
<?php
global $wpdb;
$my_posts = $wpdb->get_col("SELECT like_pid FROM wp_likes_count ORDER BY like_count");
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post__in' => $my_posts['like_pid'],
'paged' => $paged,
'posts_per_page' => 6,
'order' => 'DESC'
);
query_posts($args); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- do stuff -->
<?php endwhile; ?>