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

one time visit to the page

Although this is not a WP question, it could be done with some PHP/MySQL code. Just the psuedocode: generate a GUID value on each main page visit check if the GUID is already in the GUID database if not, store the GUID in the GUID database if GUID exists in the database, redirect to another … Read more

Show monthly or daily archives

Before WordPress 4.1, you can show the date archive page titles with the following code: (Taken and slightly modified from the twentyfourteen theme) if ( is_day() ) { printf( __( ‘Daily Archives: %s’, ‘twentyfourteen’ ), get_the_date() ); } elseif ( is_month() ) { printf( __( ‘Monthly Archives: %s’, ‘twentyfourteen’ ), get_the_date( _x( ‘F Y’, ‘monthly … Read more

Get system timestamp in wordpress

You can use PHP’s date() function here, but usually first you’ll need to run date_default_timezone_set. UTC+1 looks like Central Europe time from what I can tell, so here’s what I’d run: <?php date_default_timezone_set(‘Europe/Berlin’); echo date( ‘D, d M Y H:i:s’, now() ); ?> That will print out the current time from your server. If you’re … Read more