Paginate WordPress $ wpdb Query?
У меня есть этот запрос: <?php $query= "SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = 'votes' AND wposts.post_status = 'publish' AND wposts.post_type = 'post' ORDER BY CAST(wpostmeta.meta_value AS SIGNED) DESC LIMIT 10"; $posts = $wpdb->get_results($query, OBJECT); if ($posts ) : foreach ($posts as $post): setup_postdata($post); ?> // Post here […]