WP_Query orderby
You can do this by adding these two lines in your query: ‘orderby’ => ‘publish_date’, ‘order’ => ‘ASC’,
You can do this by adding these two lines in your query: ‘orderby’ => ‘publish_date’, ‘order’ => ‘ASC’,
Well, I succeeded in filtering the output of the totals : add_filter( ‘woocommerce_order_get_tax_totals’, ‘filter_function_name_1942’, 10, 2 ); function filter_function_name_1942( $tax_totals, $order ){ foreach( $tax_totals as $single_tax_key => $single_tax_value ){ if( $single_tax_value->rate_id == 1){ $tax_totals[$single_tax_key]->amount = 1000; $tax_totals[$single_tax_key]->formatted_amount = wc_price(‘1000′); } } return $tax_totals; } It’s just an example with hardcoded values, but it works. The … Read more
WP_Query order posts by category
You have ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, these lines define the order of the posts. ‘terms’ => $term_array it’s only define posts that have taxonomy with these is, the order doesn’t matter.
WordPress roles are stored in $wpdb->usermeta with wp_capabilities meta key, however, as a serialized array (see maybe_serialize). So you could actually make a group of meta queries, with OR as the relation, to find users with any role of your 4 defined roles, OR users having a certain meta key and value: Please note that … Read more
How to WP_Query posts order by parent title?
Sort posts using multiple custom fields and menu_order in single query?
It is not clear what you’re using as a comparison, but WP Query supports meta query comparisons and even has a DATE type. For example: $query = new WP_Query( array( ‘post_type’ => ‘attraction’, ‘meta_key’ => ‘attraction_date’, ‘meta_value’ => ’10’, ‘meta_compare’ => ‘LIKE’, ‘type’ => ‘DATE’ ) ); Using 10 is not going to get you … Read more
ad1. meta_values are strings, so they are ordered like strings, not dates. In SQL you should use some casting as a DATE before ordering ad2. better date format would be yyyy-mm-dd, because sorting this meta field like strings gives the same results as date-type column.. compare order of dates in yyyy-mm-dd 2010-03-06 2012-06-05 and the … Read more
after some trials I’ve got one solution that seems to be good but I need some tweaking help <ul class=”list-ensemble”> <?php $terms = get_terms(“production_co_type”); $count = count($terms); if ( $count > 0 ){ echo “<ul>”; foreach ( $terms as $term ) { echo ‘<li class=”title”>’ . $term->name . ‘</li>’; $args = array ( ‘post-type’=> ‘shows’, … Read more