How to compare Event period with Week period using get_posts(), meta_query, relation and compare

To be able to do this your post meta values need to be strings in a valid date format, e.g. 2022/01/31 for January 31st 2022. Note I used ISO standard timestamp format with the biggest value first, then everything descending, and avoided using a regional value such as 31/1/2022 from the UK, or 1/31/2023 from … Read more

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

tech