Order categories by name or view count
Order categories by name or view count
Order categories by name or view count
There are two solutions for that: 1. Make sure that all posts have that field set. You can do this easily – just use save_post hook and set it to default value. (You should also add default values for already existing posts that don’t have that field set.) 2. Use a little bit modified query … Read more
Sort order by slug for looped child terms of custom taxonomy
I was able to figure out the issue. it was coming from the credit card processor. Our credit card was expired and account wasn’t updated, so they disabled our account, not allowing us to process transactions through their gateway. The company we use is Plug n Pay The error ending with “C: nonp” represents “non-payment”. … Read more
By default, posts and pages are sorted after the date. If you want sort pages by “order” field, which is visible on edit page, you have to set orderby parameter: add_action(‘pre_get_posts’, ‘change_order’); function change_order($query) { if ( is_front_page() || is_home() ) { $query->set( ‘orderby’, ‘menu_order’ ); $query->set( ‘order’, ‘ASC’ ); } return $query; } Put … Read more
WooCommerce order complete email logic
get_adjacent_post() returning weird results
Understanding the orderby in WP_Query?
Sort WP posts by span value
I wouldn’t use taxonomies or custom fields for this purpose. Every time you’re add one custom field for a query, you have to add a JOIN part for that query – it means that with 10-15 custom fields, you’ll get query with 10-15 joins – so such query will be very slow. But there is … Read more