0

I have 2 custom columns, typeconsole and console:

add_filter('manage_edit-post_sortable_columns', function( $columns ) { 
        $columns['typeconsole'] = 'typeconsole';
        $columns['console'] = 'console';
        return $columns;
});

This answer allows me to sort the first column: Make custom column sortable. When pressing the second column, the first one is ordered.

How do I make them work independently?

2
  • There is no sorting code in your question, can you edit it to include it? The original answer includes a pre_get_posts filter but yours does not
    – Tom J Nowell
    Mar 2 at 23:37
  • Can you provide the code you're using the add and populate the columns as well?
    – phatskat
    Mar 3 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.