date()
PHP functions returns the value of time()
PHP functions in the specified format. time()
use server local time. If you want to get date/time based of WordPress configuration, you could use current_time()
, a WordPress function, instead of native PHP functions.
// 'timestamp' = Unix Timestamp or 'U' PHP time format
$current_time = current_time( 'timestamp' );
Related Posts:
- WP_Query orderby custom field then post_date in one query
- Filtering a WP_Query meta_query by numeric values isn’t working
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Filtering by Post Meta Custom Fields – Performance
- WP_Query: include custom post type only with specific meta value
- Returning a list of custom post types excluding those without a specific meta_value
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- wp_query check if integer exists in custom field’s array
- Possible to filter custom post type with multiple meta data?
- Query based on custom fields start and end date
- Getting a custom post’s custom field based on another custom post’s custom field select
- meta query multiple values for the same key
- Sort custom post archives by a meta value from a different custom post type?
- Custom post types – meta_query: search lesson which starts sooner
- Meta_Query refuses to return results
- Selecting posts older than the current Unix epoch timestamp
- Querying meta values within an array
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- WP_Query() show posts that end later than today
- Search multiple custom fields by using meta_query
- Sorting a query by custom field date
- Search Custom Post Type with all meta attached?
- order by meta_value serialized array
- How to sort CPT by custom meta value (date), and return posts month by month
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Combine tax_query and meta_query in WP_Query
- Filter posts with meta_query NOT IN where value has multiple values
- Sort by two dates. Default entry date and custom field if present
- Display custom post types with custom date field value (before today) & order by custom date field
- wp_query to find posts by year and month
- meta_query compare >= not working but
- Including Custom Meta with posts_where query
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Display upcoming Events for next 7 Days
- How can I get the number of custom post type posts that have a specific attachment image set?
- Problem querying Custom post type by custom fields
- Orderby CPT custom fields not working
- Query custom post type with ACF Date
- Including metaboxes from custom post types in global search — continued
- Query Multiple Custom Posts by Custom Fields
- Order Custom Post Type by Custom Field Value
- Meta Query posts not showing on ending date of custom field
- Admin Custom Meta Box – Pull Last 5 Posts from Custom Post Type
- Configuring a meta query with multiple post types that have the same relationship on a single page
- How to Output which matched meta_keys were found from custom_type_posts?
- How to let users choose where to search for posts?
- DIsplaying URL of custom field in last post of certain taxonomy && post type
- WP Query ‘posts_per_page’
- How to get specific post meta by title or id
- WP_Query orderby not work with meta_key
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- find custom post type post by searching its custom field with my string
- WP_Query of custom post type sorted by meta_key has unexpected results
- Custom Query: If One Post Object Field Value Is The Same As Another
- Custom Post type loop with ACF not displaying properly
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- Sorting by meta_key different to search criteria?
- Using WP meta query to show custom post types by a start and finish date
- Cache issue with WP_Query and custom field filtering
- Empty meta-box returns publishdate if no value is set?
- How do I list a custom field and custom taxonomies for each result in a loop?
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- order the meta query results by 2 custom fields
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- Sort custom post column by generated value?
- build child and anchestor three from post parent
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- meta query condition don’t work
- How can I query and sort custom-post type using WP_Query
- Custom query result empty on page 2
- Meta query and compare “!=” not working as expected
- Use WP_query to match post types based on custom field values
- Filter posts by their related field’s custom field
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- Post Filtered by Custom Field Value
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- sorting in wp query based on custom field value
- Not able to get my custom search result using meta_query and tax_query together?
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- Conditional posts in WP_query for search
- How to stop wp_query searching pages as well as the specified CPT
- Events with multiple event dates + permalink for each date
- Unable to get the upcoming events for custom post
- Query Event Posts by Date
- WP_Query and two custom fields returns no posts
- Storing/querying custom date data
- 404 on Pages for Custom Post Type & Query_Posts
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- Show Posts in Vertical Tabs with Scrollbar
- How to show all posts of specific custom post type with their custom fields values?
- Check for custom field value in different post type than current one and do something
- querying to custom field over ACF REST API
- Order Wp Query by earliest of 3 dates meta query
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?