I have created a custom post type, via ACF, with fields “Reference”, “Location”, “Amount2” and “Status”.
I have also successfully created a page that displays them, using a looper with the following query.
post_type=practice-for-sale&posts_per_page=-1&orderby=meta_value&meta_key={{dc:url:param key=“orderby” fallback=“reference”}}&order={{dc:url:param key=“order” fallback=“desc"}}
Following Josh’s excellent video I have also added a series of buttons to the page to allow the user to select the required sorting. Each button passes the appropriate URL: i.e. ?orderby=amount2&order=asc
Unfortunately, the sorting - particularly on the Amount field is incorrect, even though the field type is set to numeric. Instead of being numeric, they come out in the order 117,900 , 120,000 ,152,000 , 19,000, 202,204, 22,600 and so on.
What am I doing wrong?