Admin custom post ordering
Admin custom post ordering
Admin custom post ordering
How can meta values from another site in a multisite be used in a custom query?
You are right, in your current approach, WordPress does not natively support ordering by specific post types in WP_Query. However, you can still achieve what you’re looking for through a custom SQL clause. By using the posts_clauses filter, you can modify the SQL query before it’s executed. Please note that using custom SQL queries should … Read more
Yes it is, and to also sort by the post title, you would just need to add , {$wpdb->posts}.post_title <ASC or DESC> after the FIELD(), like so which results in a clause that looks like ORDER BY FIELD(wp_posts.post_type, <types>), wp_posts.post_title ASC: // Replace this: return $orderby = “FIELD( {$wpdb->posts}.post_type,” . $post_type__in_string . ‘ )’; // … Read more
As for fixing the issue in question, you should first always check that $apiresults[$bb24rrid] is set, i.e. exists, and secondly, you should create an array which stores the posts that should go at the bottom and then merge it with the $exp_query->posts array, instead of pushing items in the foreach loop. // Array of posts … Read more
Show posts in custom order
Display SKUs in admin order list for new HPOS
Can’t change WordPress / WooCommerce attribute value order
You could change the query.orderBy parameter of the query block (as long as query.inherit is not true). This parameter corresponds to the orderby query var. For number of comments, you’d use the comments_count value, as per the `WP_Query::parse_query documentation. To add this value, you’d need to be in the code editor (not visual editor) of … Read more
Using WooCommerce Hooks to add product attribute descriptions to customer order email