Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have set a custom column for date in admin, but the sorting is not working, when I click to sort the dates are jumbled up and not sorted correctly. This is the sorting function Im using

function sortable_columns() {
    return array(
        // meta column id => sortby value used in query
        'publishdate' => 'date', // e.g. 1344964575            
    );
} add_filter( "manage_edit-post_sortable_columns", "sortable_columns" );
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This tutorial from WPTuts+ will do the trick ... Quick Tip: Make Your Custom Column Sortable

In a recent article by Claudio Simeone, he demonstrated how you could add extra columns to your post, or custom post type, admin screens (or remove existing ones). In this quick tip I build on that by showing you how to make your newly created columns sortable.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.