Ticket #8022: postbypost_distinct.patch
| File postbypost_distinct.patch, 646 bytes (added by kevinB, 5 years ago) |
|---|
-
general-template.php
845 845 } 846 846 } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { 847 847 $orderby = ('alpha' == $type) ? "post_title ASC " : "post_date DESC "; 848 $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";848 $query = "SELECT DISTINCT $wpdb->posts.* FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; 849 849 $key = md5($query); 850 850 $cache = wp_cache_get( 'wp_get_archives' , 'general'); 851 851 if ( !isset( $cache[ $key ] ) ) {
