I have a list of products on a page and am trying to order them by a custom field called "price". Unfortunately, $3,950,000 is coming before $349,000. I've used a couple of codes but neither one is working. Does anyone have any suggestions? Thanks.
Here's the first code I've tried.
$query = new WP_Query( array ( 'post_type' => 'product', 'orderby' => 'meta_value', 'meta_key' => 'price', 'order' => 'ASC' ) );
Here's the other code I've tried.
$query = new WP_Query( array ( 'post_type' => 'product', 'orderby' => 'meta_value_num+0', 'meta_key' => 'price', 'order' => 'ASC' ) );