Tag Info

New answers tagged

0

OK, I found the answer myself. Turns out that in Wordpress the UTC time is hardcoded and thus using PHP's date() will always return UTC. Instead you should use WP's function current_time(). Here are more details


1

Original source : post date Create admin-script.js at your current theme ( this use js folder ) jQuery(document).ready(function($){ $('.inline-edit-col-right .inline-edit-col') .append( '<label style="margin-top: 3em;"><span class="title">Date</span>' + '<div class="timestamp-wrap"><select ...


0

Use pre_get_posts to add a meta query to the main query: function wpd_date_meta_query( $query ) { if( $query->is_post_type_archive( 'your_post_type' ) && $query->is_main_query() ){ $meta_query = array( array( 'key' => 'Date', 'value' => date('Ymd'), 'compare' => ...


0

So I actually solved this myself. Its not the most elegant solution, but it works. I figured it would help somebody. I first created a new post status using register_post_status() in functions.php. I then used pre_get_posts() also in functions.php, in which I filtered the main query on my archive page to only display posts of the status 'publish'. ...


1

I am not sure without running which query precisely this results in, but I don't think it is intended format for such query. If you take a look at Date Parameters documentation, there is a special case of after and before when you want to find posts in some direction from specific point.



Top 50 recent answers are included