Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14458

    Good evening,

    I noticed that on the frontpage in the “mainpage content area” the posted articles don’t appear (anymore?) in order of publish date.

    When I go into a special menu for articles, they appear nicely in the right order. I didnt find an option that fixes this. Also whatever published date, I add, or modify, it stays.

    The ones in the “Mainpage Slideshow” are also ok. Any idea? you can see here: http://www.edenhazard.es

    #83547

    Hi,

    You said anymore. Was it working before? When did they stop appearing in order of date?

    Regards,

    Mya

    #83548

    Hi

    I just put anymore because I assumed it may have been working before. Not sure though. The site is just starting up, I can’t say.

    Any idea where the sort is made in the code?

    Regards

    #83549

    Hello,

    Open up your index.php and find this code

    $additional_loop = new WP_Query("cat=".$negative_cats."&paged=$paged");

    Replace it with this

    $additional_loop = new WP_Query("cat=".$negative_cats."&paged=$paged&orderby=date&order=desc");

    Regards,

    Ismael

    #83550

    Hi Ismael

    Thank. I added the code, unfortunately it didn’t fix it.

    I googled around and found articles regarding a bug in a certain version of mysql 5

    The bug is about a ordering command which is ignored, when group by is used:

    A query that has a GROUP BY seems to be ignoring the subsequent ORDER BY clause. This is new as of mysql 5.0.50

    -> http://bugs.mysql.com/bug.php?id=32202

    Bug seems to be very annoying on wordpress sites. And probably also why your extra group by code above is ignored by the database.

    I have this particular mysql version:

    Current WordPress version 3.4 (?) The version of the current WordPress installation.

    Current WordPress database version 20596 (?) Increments when changes are made to the WordPress DB schema.

    Server operating system Linux (?) The operating system currently running on the server.

    Current version of PHP PHP 5.2.12 (?) The current version of PHP used on this server.

    Required version of PHP PHP 5.2.4 (?) The minimum version of PHP required to run WordPress.

    Current version of MySQL MySQL 5.0.51a-community (?) The current version of MySQL used by WordPress.

    Required version of MySQL MySQL 5.0 (?) The minimum version of MySQL required to run WordPress.

    I tested the order issue on a testserver, and i didnt have the issue there. But the mysql has an earlier version there: mysql 5.0.47

    On my live site I removed the exclusion of categories for the main page, and the sorting went back to normal.

    The issue is fixed in 5.0.52, but I dont manage the mySQL version on my hosting server so I cant upgrade myself.

    I hope it can help other people, since it took me some hours to get to the bottom of this.

    Cheerio!

    #83551

    Hey gzq5x6,

    Thanks for posting what ultimately worked for you and all the research included in it! I’ll mark this down in the “obscure bugs that cause confusing issues I should remember” folder :)

    Regards,

    Devin

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘newer posts not on top of older ones’ is closed to new replies.