July 17, 2012 at 10:17 pm #14458
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.esJuly 20, 2012 at 2:06 pm #83547
You said anymore. Was it working before? When did they stop appearing in order of date?
MyaJuly 21, 2012 at 11:01 pm #83548
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?
RegardsJuly 23, 2012 at 12:13 am #83549
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");
IsmaelJuly 30, 2012 at 8:38 pm #83550
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
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!August 1, 2012 at 5:12 pm #83551
The topic ‘newer posts not on top of older ones’ is closed to new replies.