WP_Query sort by ACF date field (newest first) with blank dates first
WP_Query sort by ACF date field (newest first) with blank dates first
WP_Query sort by ACF date field (newest first) with blank dates first
I have no idea what a ‘block number’ is, but when themes output the date for a post they will use either the_date() or the_time() (or both). You can replace the output using the filters the_date() or the_time(): add_filter( ‘the_date’, function( $the_date, $format ) { $block_number=”whatever a block number is”; return $block_number; }, 10, 2 …
WordPress is not multilingual out of the box. It needs a third party plugin to be. The date will be displayed as defined in the settings according the website language also defined in the WordPress settings? Regards
I don’t see a function to do what you want directly, but it is not hard to retrieve the format that WordPress has configured: $df = get_option(‘date_format’); $tf = get_option(‘time_format’); You can then substitute $df wherever you had a hard-coded date format (or $tf for a time format). In your example, that would look like …
Doesn’t your script state to expire the post if it’s expire date is before tomorrow? Wouldn’t that make it expire a day sooner? If it’s set to expire the 12th, and it’s the 11th, 11+1 = 12, so expire it. Wouldn’t you rather either subtract 1 day instead of add 1 day, or add the …
Exclude posts by date – related post
Using query_posts is pretty much always a bad idea as it causes another database query but it also will break pagination and can cause other issues as well. What you need it a filter on pre_get_posts. function pgp($qry) { if (!is_admin() && is_main_query() && $qry->is_category(3709)) { $qry->set(‘orderby’,’meta_value’); $qry->set(‘meta_key’,’Deadline’); //formatted YYYYMMDD $qry->set(‘ignore_sticky_posts’,true); } return $qry; } …
WP_Query() displaying past post / event
Dynamically update Custom Fields to display new dates
Order Wp Query by earliest of 3 dates meta query