Meta Query posts not showing on ending date of custom field
Meta Query posts not showing on ending date of custom field
Meta Query posts not showing on ending date of custom field
There is no logical explanation why if( is_post_type_archive(‘news) && is_date()) should fail and not work in your situation. is_date() return true on all date archives is_post_type_archive( ‘news’ ) will return true on post type archives When you visit localhost/2016/02/?post_type=news, both of those ring true, and they will only ring true on that specific URL If … Read more
WordPress Date with ACF
Make WordPress use timezone for email Date header
Try this: add_action(‘publish_post’, ‘dp_expiry’); function dp_expiry( $data ) { /*adds 2 weeks onto the current date in unix epoch format*/ $dp_new_expiry_date = (strtotime( current_time( ‘mysql’ ) ) + 1209600); /*converts unix timstamp back to yyyy-mm-dd format like you required*/ $dp_new_expiry_date_conv = date(“Y-m-d”, $dp_new_expiry_date); update_post_meta( $data[‘post_id’], ‘postexpiry’, $dp_new_expiry_date_conv ); }
your code is not working, because you use strtotime incorrectly… It should be used like this: int strtotime ( string $time [, int $now ] ) But you pass formatted dated as first param, and another string as second one. So how should it look like? Like so: $addeddays = intval( get_user_meta($this->order->user_id, ‘xxx’, true) ); … Read more
You can check the post type with get_post_type(). You only want to display the content if the value is post: function wpb_last_updated_date( $content ) { $u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); if ( get_post_type() === ‘post’ ) { if ( $u_modified_time >= $u_time + 86400) { $updated_date = get_the_modified_time( ‘F jS, … Read more
WPForm, how to set date to tomorrow
Meta query: How do I return posts within a date period from a given month?
OK, so you’ve got a couple of ways to go about this, but first, you need to decide how urgently you want to inform the user that their value is invalid: immediately, or when the post is saved? A general rule of thumb would suggest that earlier is better, but given that you seem to … Read more