I want to Add My Product Image to Admin Order Email in Woocommerece [closed]

The default admin email can be found in woocommerce/templates/emails/admin-new-order.php the order items table is called in line 28, with a function called email_order_items_table. This function also takes an argument for including the thumbnail (see the class-wc-order.php, line 1052). if you copy the email templates to your theme folder, you can edit the admin-new-order.php file and … Read more

Ascending Order is not Working in Custom Post Type Listining

If you want to sort the custom post type ‘product’ by title, please try: array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘genre’, ‘field’ => ‘slug’, ‘terms’ => ‘ne’, ) ) ) where ‘field’ can in general be either ‘id’ or ‘slug’ (ref). You … Read more

While loop articles – if statement order

Prepare the query before you loop over it: $first = array_shift( $the_query->posts ); $second = array_shift( $the_query->posts ); // now re-add in reverse order array_unshift( $the_query->posts, $first ); array_unshift( $the_query->posts, $second ); // this is now the first item while ($the_query -> have_posts()) : $the_query -> the_post(); // regular loop

WP Query – Is this correct?

I am guessing but based on your choice of placeholder names in the code above… $args = array( ‘meta_key’ => ‘myvalue’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’ ); … your meta_key argument is wrong. That is the meta key not the meta value as your naming convention suggests. meta_key (string) – Custom field key. http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters … Read more

Archive not sorting correctly

Have a look at the orderby parameters for WP_Query to see all of the valid values that can be. If wpcf-start-time is a meta key, then orderby should be meta_value, which will also require you set a meta_key argument to tell WP what meta key you want to order on- } elseif ($q->is_post_type_archive(‘cif-events’)) { $q->set(‘orderby’, … Read more

How Do I Get My Post Tags to Alphabetize?

You could use the filter term_links-post_tag to sort tags while ignoring their case: add_filter( “term_links-post_tag”, ‘themeslug_sort_tags_alphabetically’ ); function themeslug_sort_tags_alphabetically( $tags ){ natcasesort( $tags ); return $tags; } This code is to be placed in the functions.php of the child theme.

how to get post order by post id wp_query?

OK, so you want to define posts order by yourself. WP_Query allows you to do that – you’ll have to use orderby => post__in to achieve it. And that’s what you do. So why isn’t it working? Because of a typo 😉 Ordering posts by post__in preserves post ID order given in the ‘post__in’ array. … Read more