Order by category ID, not by post date
-
Hello,
this is my export function:
<?php if ($post_ids) { global $wp_query; $wp_query->in_the_loop = true; // Fake being in the loop. // fetch 20 posts at a time rather than loading the entire table into memory while ( $next_posts = array_splice($post_ids, 0, 20) ) { $where = "WHERE ID IN (".join(',', $next_posts).")"; $posts = $wpdb->get_results("SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = 'heberg' ORDER BY wpostmeta.meta_value DESC"); foreach ($posts as $post) { // Don't export revisions. They bloat the export. if ( 'revision' == $post->post_type ) continue; setup_postdata($post); ?>
i would like to make the posts order by category ID, how to do that?
bye
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Order by category ID, not by post date’ is closed to new replies.