Title: Numeric range search using get_posts
Last modified: August 21, 2016

---

# Numeric range search using get_posts

 *  Resolved [mali303](https://wordpress.org/support/users/mali303/)
 * (@mali303)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/numeric-range-search-using-get_posts/)
 * Hi,
 * I have a field in my custom post type to store price and need to implement search
   features to get results on the bases of price range. I have tried with operators‘
   <‘ and ‘>’ but the search term is going as string so the results are not accurate.
   Is there a way to do this?
 * Thanks in advance.
 * [https://wordpress.org/plugins/custom-content-type-manager/](https://wordpress.org/plugins/custom-content-type-manager/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [GenealogyCoach](https://wordpress.org/support/users/samatva/)
 * (@samatva)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/numeric-range-search-using-get_posts/#post-5160480)
 * Not sure this is a CCTM question….
 * get_posts is not the way to search.
 * See instead [http://codex.wordpress.org/Class_Reference/WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query)
 *  Thread Starter [mali303](https://wordpress.org/support/users/mali303/)
 * (@mali303)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/numeric-range-search-using-get_posts/#post-5160481)
 * Thanks for the response Samatva.
 * CCTM has it’s own custom version of get_posts in GetPostsQuery class.
 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/numeric-range-search-using-get_posts/#post-5160544)
 * If the GetPostsQuery class is experiencing errors with its filters, then please
   report a bug. I wrote that class to compensate for the shortcomings and inconsistencies
   I was experiencing with the various WP database APIs.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Numeric range search using get_posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-type-manager_c9c790.
   svg)
 * [Custom Content Type Manager](https://wordpress.org/plugins/custom-content-type-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-type-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-type-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-type-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-type-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-type-manager/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/numeric-range-search-using-get_posts/#post-5160544)
 * Status: resolved