Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Custom wp_query time filter on meta_value

You can use the WP query_posts to filter about your custom values; ean example:

query_posts('meta_key=my_type&meta_compare=<=&my_value=20&orderby=my_value');
if (have_posts()) :
while ( have_posts() ) : the_post();

But, i think you must replace the time-values for readable string, maybe woth strotime, that you have the same format for the query.

Related Posts:

  1. Filter by one custom field, order by another?
  2. Use REGEXP in WP_Query meta_query key
  3. How to hook a filter to catch get_post_meta when alternate a custom field output?
  4. How to use update_{$meta_type}_metadata filter to modify meta value
  5. What is the most efficient way of querying posts based on visits and date for current day?
  6. How can I display image metadata?
  7. How to filter into post meta data before saving
  8. Explanation for remove_filter used in the below code [closed]
  9. Filter list by a unique meta value dilemma
  10. How to remove get_post_metadata using remove_filter inside a class?
  11. Sorting and limitation with pre_get_posts
  12. Filter for author list in gutenberg core editor
  13. Filter posts by meta data using custom query
  14. Filtering by multiple conditions in the loop
  15. Excluding posts by meta, and also keeping posts without the meta
  16. How to add more than one custom metadata as filter on the post list page?
  17. Hide H1 Title using the_title filter
  18. Adding an orderby filter, casting postmeta with multiple keys
  19. Disable emojicons introduced with WP 4.2
  20. How to remove a filter that is an anonymous object?
  21. Query all posts where a meta key does not exist
  22. How to only display posts whose meta_value field is not empty?
  23. WordPress hooks/filters insert before content or after title
  24. How to add defer=”defer” tag in plugin javascripts?
  25. Can wp_query return posts meta in a single request?
  26. add_action(), add_filter() before or after function
  27. apply_filters(‘the_content’, $content) vs do_shortcode($content)
  28. order by numeric value for meta value
  29. How do filters and hooks really work in PHP
  30. Trouble understanding apply_filters()
  31. What is the very earliest action hook you can call?
  32. How would one modify the filtering Gutenberg applies to pasted content?
  33. How can I modify the WordPress default widget output?
  34. Add custom options to the wplink dialog
  35. Remove classes from body_class
  36. what is __return_false in filters
  37. Explanation for apply_filters function and its variables
  38. Gutenberg: Is there a way to know if current block is inside InnerBlocks?
  39. How to reorder billing fields in WooCommerce Checkout template? [closed]
  40. Insert HTML just after tag
  41. the_content and is_main_query
  42. Meta query with boolean true/false value
  43. Changing WooCommerce Display Price Based on User Role & Category [closed]
  44. How to add a custom CSS class to core blocks in Gutenberg editor?
  45. How to show page content in feed?
  46. wp_headers vs send_headers. When to use each?
  47. Filter any HTTP request URI?
  48. How to Pass External Variables to Filters/Actions
  49. How do I query for posts by partial meta key?
  50. How to filter users on admin users page by custom meta field?
  51. Not able to change wp_title using add_filter
  52. Get post with multiple meta keys and value
  53. How to appending to the_content using add_filter with custom post type?
  54. Query WP REST API v2 by multiple meta keys
  55. No filter of code on switch from html to visual editor, how?
  56. Sanitize and data validation with apply_filters() function
  57. How to modify posts_where filter only for the search query
  58. How to get shortcode’s input values inside a filter?
  59. Removing Image and Caption Dimension Attributes
  60. How to wrap oEmbed-embedded video in DIV tags inside the_content?
  61. How to bulk delete all users with no posts?
  62. How many filter/action hooks are healthy?
  63. WordPress 3.9 – Trouble Editing TinyMCE 4.0
  64. Changing JPEG compression depending on image size
  65. How to add filter with 2 args?
  66. Why is javascript allowed in my post content?
  67. WordPress retrieving meta data for all custom post types in list view
  68. How to wrap an element around an iframe or embed in content automatically?
  69. Filter specific shortcode output?
  70. WordPress Internal @ Mentions
  71. How to add headers to outgoing email?
  72. Earliest hook to reliably get $post/$posts
  73. Insert new element to array with add_filter
  74. Order by optional meta key?
  75. LESS CSS enqueue_style with add_filter to change rel attribute
  76. Is it possible to filter comments in a post so a user can only see the comments they have written?
  77. How to pass/get data to/from the WooCommerce data-product_variations object?
  78. Remove Editor From Homepage
  79. How to modify Contact Form 7 Success/Error Response Output [closed]
  80. meta_query: using BETWEEN with floats and/or casting to DECIMAL
  81. Filter WP_Query for posts having a certain meta-value
  82. Where to hook into post content?
  83. What does (10, 2) mean when used with add_filter
  84. Filter translations (gettext strings) on specific admin pages
  85. Filter username field on registration for profanity and unwanted words
  86. Clarification on filters and hooks
  87. remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
  88. At what priority does add_filter overwrite core functions?
  89. How to list some posts first in the loop based on post id
  90. Whats the difference between post_limits and pre_get_posts?
  91. Valid characters for actions, hooks and filters
  92. is it possible to add “extra” table nav to edit-tags.php screens?
  93. Advanced Custom Fields and Yoast SEO keyword analysis [closed]
  94. Adding a filter to qTranslate to change display of language chooser
  95. Insert Custom HTML After Shortcode
  96. Modify links when inserted by WYSIWYG editor
  97. Is there a way to add another row to the tinyMCE kitchen sink toggle?
  98. How to hook into unregistering a widget instance?
  99. How to check if a hook is hooked or not?
  100. Reduce or prevent calling of update_meta_cache
Categories filters Tags filters, post-meta, wp-query
Inserting code to HTML view from a pop up initiated from visual view
redirecting from a general category page to another specific one

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress