How to make “page template” admin column sortable?
How to make “page template” admin column sortable?
How to make “page template” admin column sortable?
display two things in one admin panel column list
Sorting by multiple meta keys (ref) may be helpful (untested): add_action( ‘pre_get_posts’, function ( \WP_Query $query ) { $orderby = $query->get( ‘orderby’ ); if ( ‘start_date’ === $orderby || ‘end_date’ === $orderby ) { $meta_query = array( ‘relation’ => ‘OR’, ‘meta_query_1’ => array( ‘key’ => $orderby, // start_date or end_date ), ‘meta_query_2’ => array( ‘key’ … Read more
The WP_User_Query::parse_orderby() actually supports sorting by the number of posts, but because WP_User_Query::parse_orderby() limits by what users can be sorted, accomplishing a custom sort is a bit of a hack. Here’s the workaround I’ve created (semi-tested): add_filter( ‘manage_users_sortable_columns’, static function ( $columns ) { $columns[‘articles_count’] = array( ‘articles_count’, false, __( ‘Articles’ ), __( ‘Table ordered … Read more
The columns appear vertically because when printing, the viewport is considered quite narrow. For the column blocks to appear horizontally next to each other, they have this in the CSS for the core/columns block: @media (min-width:782px) { .wp-block-columns { flex-wrap:nowrap!important } } This media query does not pass when printing, thus the columns appear vertically. … Read more
The correct action hook for printing custom column content is manage_loads_posts_custom_column, not manage_invoices_posts_custom_column (tested). This is because the row is itself for a loads post type, and not an invoices post type. Because you’re on the page for invoices, the filter to add columns works with invoices. Tested: add_action( ‘manage_loads_posts_custom_column’, ‘invoice_custom_column’, 10, 2 ); I … Read more
There is a way to do this without writing CSS but it has its limitations. The styling will have to be tailored to the content and care taken to keep it working if the content changes. You’ll have to be using a version of WP >= 6.2 and nest the title, description and button within … Read more
If I am understanding right, you’re suggesting creating separate database tables both for your post type and taxonomies. You don’t really need to do that at all. Just create a custom post type which WordPress will store in the {prefix}_posts table, and create a custom taxonomy for that post type which WordPress will also handle … Read more
sort by date in users
the_modified_author() returning blank