How can I order all subcategories alphabetical independent of the parent categories?
How can I order all subcategories alphabetical independent of the parent categories?
How can I order all subcategories alphabetical independent of the parent categories?
How to sort store location by specific category order in WP store locations
Try this. I followed the WP_Query docs to build this. $args = [ ‘meta_query’ => [ ‘relation’ => ‘AND’, [ ‘_stock_status’ => [ ‘key’ => ‘_stock_status’, ‘compare’ => ‘EXISTS’, ], ‘_sale_price’ => [ ‘key’ => ‘_sale_price’, ‘compare’ => ‘EXISTS’, ], ‘_price’ => [ ‘key’ => ‘_price’, ‘compare’ => ‘EXISTS’, ] ] ], ‘orderby’ => [ … Read more
Access custom meta_data in processing order email
If your code works but it works for all emails you can add a check for only completed orders like this add_action( ‘woocommerce_email_before_order_table’, ‘mm_email_before_order_table’, 10, 4 ); function mm_email_before_order_table( $order, $sent_to_admin, $plain_text, $email ) { // if not completed order, exit if ($email->id != ‘customer_completed_order’) return; echo ‘<p>extra information</p>’; }
How can I order a post query’s results based on the number of matching taxonomy terms?
I think you’ll just need to loop the loop and first build a helper array to contain the hierarchy, then work with that to print out any necessary html. Caching the resulting helper array to a transient might be a good idea to save processing time. // is there a transient? $transient = get_transient( “parent_children_ids_{$post_id}” … Read more
Sorting my posts on homepage my specific value in post_meta table
I think the problem is that you have multiple meta values so your order by should be more targeted, like this. $args[‘orderby’] = array( ‘mp_exists’ => ‘ASC’, ‘mp_not_exists’ => ‘ASC’, ‘title’ => ‘ASC’ ); I don’t know by what meta you want to order so I added both of them, remove as necessary.
This isn’t possible with WP_Query. To achieve your goal multiple queries are necessary, one for each country, with the results fetched separately then combined in PHP manually. You also can’t use meta_query to sort, meta_query is for filtering/searching post meta, which is very expensive and gets slower as your meta table gets larger. Post meta … Read more