Wordpress problems - posts in reverse order - fix - howto
I recently had to fix a problem with a wordpress installation, which appeared to be generating the posts in reverse order.
Having searched around, I found a solution here, which was basically to add a plugin to wordpres, that adds a filter to the posts, ordering them by date_posted.
The following code should be put into a file, within the wp-content/plugins
section of the wordpress installation, with a .php extension:
php
/*
Plugin Name: Matts Magic Reverse Order Fix
Plugin URI:
Description: Changes the GROUP BY id in GROUP BY post_date (Problem in MySQL 5.0.51). this is a temporary fix until MySQL is updated/fixed - based on code from Ingo Henze(http://putzlowitsch.de/ @ http://wordpress.org/support/topic/152048)
Author: Matt Stabeler
Version: 0.10
Author URI: http://stabeler.com/
*/
// GROUP BY
function tempfixgb_posts_groupby( $groupby ) {
if( preg_match( "/(|[ ,.])id(|[ ,])/i", $groupby ) )
$groupby = 'post_date';
return $groupby;
}
add_filter( 'posts_groupby', 'tempfixgb_posts_groupby' );
?>
Then you need to activate the plugin in the Wordpress admin section under plugins
based on post by Ingo Henze