Answer taken from here: meta_query: using BETWEEN with floats and/or casting to DECIMAL
add_filter('get_meta_sql','cast_decimal_precision');
function cast_decimal_precision( $array ) {
$array['where'] = str_replace('DECIMAL','DECIMAL(5,2)',$array['where']);
return $array;
}
Related Posts:
- How to support extra color options for shortcodes?
- Custom terms in custom category taxonomy
- how to register / add multiple options into one field in wordpress?
- Custom options – register, defaults and delete empty fields (Settings API)
- Customize TinyMCE Buttons
- Apply `the_content’ filter to theme customisation live preview
- Template setting is not saving in wordpress
- How to cdv from a custom CMS to WP
- How to keep the /blog slug even in single post slug
- Custom WP deactivate an email activation link sent to user’s email.
- How to customize the gallery shortcode in WordPress?
- “Static” pages within a theme
- Create a folder if it doesn’t already exist
- How to setup a taxonomy that can have only one post assigned to it?
- Two searchforms with different categories/posts per page
- Unable to show messages using ‘admin_notices’
- How can I add a Description column to the media library browser screen?
- Custom folder structure and problem with 3rd party services
- Search a meta field for a value in all posts
- How to delete orphan userdata from array in wp-options
- How to place the captcha just below the comments text area
- Multiple posts categorized by day?
- How to strip thumb from widget
- To merge customized codes upon wordpress update
- Remove Twenty Twelve themes responsiveness in Internet Explorer
- customize footer widgets area
- Logged in only custom page
- Adding pages to the Admin panel
- Customize Admin Section
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Want home page to click through to two different page types
- add unique code required to register
- Custom single page based on which custom page template is selected
- Setting up staging area
- retrieve theme custom settings
- Customized Comment Form Issues
- How to duplicate “Pages” section in the control panel?
- Setting Custom WordPress “Posts page” AS “Front page”
- featured images – custom links
- WordPress Customize panel – accessing the values
- Assign classes to Custom fields
- WP Customizer – what types of fields is it capable of supporting?
- Grouped custom taxonomy query
- Using Custom Fields in post, need to put into the_content
- Custom WordPress SQL Query 4 posts per custom taxonomy
- Get a different size of Image thumbnail while working with custom metabox
- Custom search by several options send on form not works
- How to make my wordpress site responds for 2 domains
- Page template with custom html fields inside a content
- Upload files in wordpress
- Pagination is not working on custom query
- User registration add user ID?
- Can’t Auto-Update, but permissions are good?
- Custom Style per Post, How to Display Custom-Styled Single post on Homepage?
- Issue with WordPress native theme customizer function and jquery ui tabs
- Changes in comments.php in the child theme does not show up on the site
- Twenty Eleven theme, how to change style to a specific “format”
- Custom image sizes ignored in WP 3.5
- Search results load individual post in slide out div
- Share user access between two wordpress sites
- Accessing + retrieving custom database in WordPress
- What capability is required to view posts, scheduled in the future, by someone else?
- Looking for a way to take readers to random post when clicking a link
- Problem Locating and Changing Alt Attribute Of Link
- Custom MySQL query to list post
- Need Advice to Working with Custom Post Meta
- Custom Query Arguments
- How to create functions that affect only a specific user
- If I want social media icons that link to my site’s corresponding accounts, is that better to do with a plugin, or manually?
- Pull certain WordPress posts on custom CMS instead and 301 wordpress to it?
- pull custom fields values from wp-database in a nested foreach loop
- Create advanced portal website with sections – taxonomy usage?
- Create dashboard setting which lets me set ID of category which is inserted into template
- wp_rewrite not working on third level url
- Custom Query for Taxonomy
- What is Global WordPress Objects?
- How to remove the tagline from the HTML ?
- Custom table or form
- Using str_replace on wp-admin
- Setting variables as custom field values
- Single page template
- how to modify request to get_template_part()?
- WordPress uploads directory. Featured Images storage
- Cannot upload to S3 using CDN Sync Tool
- Document.body.scrollTop in WordPress
- Post thats in Two Categories, only want to display name for one
- Adding page Title in a custom coded page
- Reached end of document without finding – using mod_pagespeed
- Custom Slider Per Page created
- Custom Import with taxonomies
- updated permalink structure on localhost does not work
- Show Site Name on WP login screen
- Adding css and js to a blank page created with custom template
- why jquery is not loading in wordpress page?
- Word Press Theme Customiser and Child theme Function.php
- Security Issues with custom user role or changing core role capabilities?
- Customise default site setup
- menu customization
- Adding a third custom taxonomies
- customize page is blank after installing wordpress 4.7.2