WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)

Resolved. My error are there : $FirstDayThisMonth[] = date(‘Y-m-01 00:00:01’, mktime(0, 0, 0, $x, 1)); $LastDayThisMonth[] = date(‘Y-m-t 23:59:59’, mktime(0, 0, 0, $x, 1)); instead of : $datestart = strtotime(date(‘Y-‘.$nbofmonth.’-01 00:00:01′)); $dateend = strtotime(date(‘Y-‘.$nbofmonth.’-t 23:59:59′)); It’s always very annoying to have well written code and to realize that a small element breaks everything

Display Current Time using shortcode

Add this code in Theme function file functions.php function timeZone_funch( $atts ) { extract(shortcode_atts(array(‘timezone’ => ‘Asia/Kolkata’), $atts)); /* Asia/Kolkata is default Timezone */ $output=””; if (in_array($timezone, DateTimeZone::listIdentifiers())) { date_default_timezone_set($timezone); $currentTime = date( ‘d-m-Y h:i:s A’); $output = $currentTime; } else { $output = “Invalid Timezone”; } return $output; } add_shortcode( ‘current_time’, ‘timeZone_funch’ ); USAGE: [current_time … Read more