Search for:
Jump to: 
Your Ad Here
Author Message
 Post subject: How to search for decimal values in post meta using WP_Query
PostPosted: Mon Apr 29, 2013 11:56 am 
Offline

Joined: Mon Apr 29, 2013 8:14 am
Posts: 4
I need to search some posts based on their ratings. Ratings are stored with in the post metas.

$args = array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'rating',
'value' => array(2.5, 4.0),
'type' => 'DECIMAL'
'compare' => 'BETWEEN'
)
)
);
$query = new WP_Query( $args );

Using above code i am not able to search posts for the decimal or float values. Is there any way to make it work? I am using WordPress 3.1.1.

_________________
Expert PHP Programmers


Top
  
 
   [ 1 post ] 

1, 2, 3, 4, 5 ... 414
Recent topics  Replies   Views   Last post 
No new posts CCavenue integration in php

by rajkumar » Fri Mar 04, 2011 3:34 am in Payment Gateways

3

7890

Tue Apr 30, 2013 5:51 am

sagarpatil0710 View the latest post

No new posts Android SMS & Contacts Backup

by dvdriper2020 » Tue Apr 30, 2013 3:46 am in Payment Gateways

0

18

Tue Apr 30, 2013 3:46 am

dvdriper2020 View the latest post

No new posts Backup SMS for Android

by dvdriper2020 » Tue Apr 30, 2013 3:26 am in PHP-Code Help

0

155

Tue Apr 30, 2013 3:26 am

dvdriper2020 View the latest post

No new posts How to change joomla urls as SEO friendly

by aababu » Fri Sep 18, 2009 1:32 pm in Others(phpBB, phpfox, etc..)

4

2268

Mon Apr 29, 2013 11:58 am

jimmybrion View the latest post

No new posts How to search for decimal values in post meta using WP_Query

by jimmybrion » Mon Apr 29, 2013 11:56 am in Others(phpBB, phpfox, etc..)

0

381

Mon Apr 29, 2013 11:56 am

jimmybrion View the latest post


Your Ad Here