You could try this instead:
$bc_args = array(
'post_type' => 'data',
'data-category' =>'insurance-rate',
'order' => 'DESC',
'orderby' => 'meta_value_num',
'meta_query' => array(
array(
'key' => 'interest_rate',
'value' => (int) $i_rate,
'type' => 'numeric',
'compare' => '>='
),
)
);
$sortedPosts = new WP_Query( $bc_args );
where we use the numeric type.
You should also consider using filter_input instead of $_GET:
$i_rate = filter_input( INPUT_GET, 'i_rate', FILTER_SANITIZE_NUMBER_INT );
or the native add_query_var / get_query_var way.
Ps: data-category is not a native parameter in the WP_Query() class.
Related Posts:
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- Getting attachments by meta value
- querying with custom meta field with meta_query
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- WordPress altering my custom query, How to fix it?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Order by meta_key in custom post type doesn’t affect the query
- meta_key and meta_value not working together
- Order Posts by meta value AND published date
- How to make Meta Query case sensitive?
- Fetch Record based on meta key dates
- Meta_query with multiple keys and multiple values
- meta_query BETWEEN, but the range is stored in the custom field
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Large AND OR query timing out
- meta_value_num not ordering all items
- Display posts with specific value first in query
- Get every post with value in meta key
- add_query_arg to compare and display events from a certain date
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- meta_query weird behaviour, static int will work, but not user data
- Query multiple post types, but different order for each
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How do i create a custom post query when the meta value is an array?
- WP Query – grouping posts by same meta key, adding together values from another key
- meta_query is overriding default search
- Trouble with serialized metadata
- Comparing Meta Field date in WPQuery using Meta_Query?
- Getting posts by custom field value
- Query against multiple locations within single custom post type post
- WP_Query, ACF field and array
- Order by Date Custom Field
- Query by meta value (add a dropdown of all values)
- Order Posts By Custom Field That is an array of objects
- Custom WP_query and integrating into theme file
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Compare meta key separation
- query post based on comparison
- Get posts by meta value except one post [closed]
- How to get products with the same custom attribute like ean code
- meta_query with meta values as serialize arrays
- Use REGEXP in WP_Query meta_query key
- Function in array as arguments for WP_Query
- How to Compare Two Meta Fields
- WP_Query to show post from a category OR custom field
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Compare meta_query decimals not working right
- Display two post types ordered by two custom fields
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to get user_id from wordpress database inside ajax function?
- getting posts and number by specific meta value in multiple meta
- WP_Query with multiple meta fields filter?
- How to orderby meta_value_num with dollar ($) sign
- Meta Query Array Error 500
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- How to Filter Posts by Custom Fields?
- wp_query check if integer exists in custom field’s array
- meta_query not working as expected
- Meta Query And/Or
- WP Group posts by year(desc) > month(desc) > date(asc)
- Query posts with “non set” meta value
- Is it possible to retrieve all posts with a certain value for metadata?
- Ordering a mysql style datetime stamp with meta_query
- wp_query get data from advanced custom field in wordpress
- Wp_query with 2 meta keys and array of meta values
- meta_query: check if number exists
- Event with multiple dates, display events chronologically
- WP ForLoop to compare meta information of posts to determine what post to display
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- Querying a large number of posts including their custom fields data
- WP Query / Meta Query [duplicate]
- Query posts by searching for a string in a meta field
- How to add date_query to meta_query array
- Combine query in WP_User_Query()
- Multiple nested meta queries
- How can I modify the query by adding to the existing query?
- WordPress Query custom ordering by temporary variable
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Filtering WP_Query based on wp_postmeta keys values
- using custom meta user data to run queries in WordPress
- Multiple meta_query not working
- compare for multiple meta values for same key in wp_query
- datetime picker, timestamps and meta queries
- WP_Query with meta_query won’t orderby
- meta_query only check if both value are set
- Meta key in wp_query bug?
- Wrap group of wp query posts to parent div by date/year
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Sorting Posts with meta value not working
- Looking for a way to exclude frontpage and nav menu from query filter
- Creating Custom Query
- WP_Query by meta key not returning any posts
- Display only posts with thumbnails
- How to use meta_query to retrieve posts from multiple custom post type