Had been puzzling over the sort order of the posts in WordPress since a recent upgrade. For no reason, it kept showing the earliest post first instead of latest.
Here’s the solution!
// GROUP BY auswerten
function plw123ngb_posts_groupby( $groupby ) {
if( preg_match( "/(|[ ,.])id(|[ ,])/i", $groupby ) ) {
// GROUP BY auf post_date setzen
$groupby = 'post_date';
}
return $groupby;
}
add_filter( 'posts_groupby', 'plw123ngb_posts_groupby' );
http://schnurpsel.de/wordpress-und-die-suboptimale-mysql-optimierung-5051-74/
http://wordpress.org/support/topic/how-do-i-fix-the-sort-order-of-my-posts
hi guys i want to add “sort post terms” in search or archive pages ?
for example http://goo.gl/K9sXz
more example : http://goo.gl/SjYjs
Most Commented | Most Recent or Alphabetical
how to do this ? please help me
thanks in advance 🙂
please please email me if you reply