Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Fixing WordPress
    In reply to: Sorting blog posts
    Thread Starter andersdrengen

    (@andersdrengen)

    Got this one myself, so it’s solved now – it’s due to a problem/error in MySQL v. 5.0.51 that creates this behaviour. Upgrading to 5.0.52 resolves this. If that’s not possible, I found this piece of code that can be used instead as plugin…

    <?php
    /*
    Plugin Name: 123 No Group By ID
    Plugin URI:
    Description: Changes the GROUP BY id in GROUP BY post_date (Problem from MySQL 5.0.51).
    Author: Ingo Henze
    Version: 0.10
    Author URI: http://putzlowitsch.de/
    */ 
    
    // GROUP BY auswerten
    function plw123ngb_posts_groupby( $groupby ) {
    if( preg_match( “/(|[ ,.])id(|[ ,])/i”, $groupby ) )
    $groupby = ‘post_date’;
    return $groupby;
    }
    
    add_filter( ‘posts_groupby’, ‘plw123ngb_posts_groupby’ );
    ?>
Viewing 1 replies (of 1 total)