Make custom column sortable

I have a added custom column to a custom post type, and it works fine. I just want it to sort the names by title, so I tried this, function sortable_custom_columns( $columns ) { $columns[‘custom_column’] = ‘title’; return $columns; } add_filter( ‘manage_edit-custom_sortable_columns’, ‘sortable_custom_columns’ ); However, that is returning very random sorting. I think it may … Read more

Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?

I’m currently trying to output a list of music titles and would like to have the sorting ignore (but still display) the initial article of the title. For example if I had a list of bands it will be displayed alphabetically in WordPress like this: Black Sabbath Led Zeppelin Pink Floyd The Beatles The Kinks … Read more

How do I set the default admin sort order for a custom post type to a custom column?

SOLUTION AVAILABLE HERE I’ve set up a custom post type called clientarea, and set up several custom columns for it in the admin area – the custom columns are all custom meta fields, as you can see from my code. I’d like to sort by ‘Appointment Date’ descending by default. All of the columns work … Read more

Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title

I’m working on a custom taxonomy term page template where we want the items that are connected to the term sorted by a publication date (custom date field) – and if there are multiple items on the same day (formatted like YYYY-MM-DD) to then sort those by title, and finally sort by title if the … Read more