Revert "some testing and bugfixing of sort_posts\nsome parts need redesign"

This reverts commit 61d1b24ef4c125d748e2657e09f696e4fc777391.
Revert "Revert "some testing and bugfixing of sort_posts\nsome parts need redesign""

This reverts commit feab864e6cecbf737f59fa254449436c1c713bff.
Revert "some testing and bugfixing of sort_posts\nsome parts need redesign"

This reverts commit 61d1b24ef4c125d748e2657e09f696e4fc777391.