Trying to change database tables storage engine to innodb gives error “invalid default value for ‘post_date'”
Trying to change database tables storage engine to innodb gives error “invalid default value for ‘post_date’”
Trying to change database tables storage engine to innodb gives error “invalid default value for ‘post_date’”
Changing wordpress publication date to ACF date and time picker date not working
Trash / Draft a WordPress custom post after custom date field expires
How can I create ‘future’ and ‘past’ parameter for restAPI by filtering the CPT custom date field by greater than / less than current datetime?
I’m wondering if I can use any of the functions listed in the @wordpress/date package to convert a GMT date to a date in the user’s locale. Yes, you can use the dateI18n() function. However, the source date (i.e. the 2nd parameter for the above function) by default uses the time zone of the user’s … Read more
According to docs you can retrieve such set of posts by using Time Parameters with query_posts(), but note that it will likely horribly break your pagination and links to older entries.
that’s going to be a bit tricky since WordPress doesn’t relate date and time format to language. so to get the current language from the browser you can use $_SERVER[‘HTTP_ACCEPT_LANGUAGE’] and then based on that you can change the date format: function update_date_format(){ $lang = substr($_SERVER[‘HTTP_ACCEPT_LANGUAGE’], 0, 2); if (strpos($lang, ‘au’) > 0){ $date_format=”d/m/Y”; // … Read more
Please see this documentation for the usage about the_time(). You are not supposed to add html inside the parameter of the_time(). (edit: use get_the_time() with in string concatenation) To solve this, try this code: echo ‘<div class=”post_date”><div class=”month”>’.get_the_time(‘F’).'</div>’.'<div class=”day”>’.get_the_time(‘d’).'</div><div class=”year”>’.get_the_time(‘Y’).'</div></div>’; edit: corrected to the use of get_the_time()
WordPress always sets time zone to UTC and native PHP functions will report and operate that in its environment. To get local time (adjusted from UTC by WP’s timezone setting) you need to use WP’s functions, such as date_i18n() and others. It’s confusing, but it’s much less problematic to do it WP way, than try … Read more
Assuming, as per the above comment, the format of the dates is YYYY/MM/DD: $args = array( ‘posts_per_page’ => 1, ‘cat’ => 6, ‘meta_key’ => ‘begin_date’, // adjust to actual key ‘meta_value’ => date( ‘Y/m/d’ ), ‘meta_compare’ => ‘>=’, ‘order’ => ‘ASC’, ‘orderby’ => ‘meta_value’ ); $wpse72195_query = new WP_Query( $args ); // do something with … Read more