Many CPT is conflicting of the custom date

If your posts store the date in a consistent format like YYYY-MM-DD HH:MM:SS, etc, you could compare with strings using regular expressions, like: $current_date = new DateTime(); $datemonth = $current_date->format(“m-d”); // MM-DD $args = array( // … ‘meta_query’ => array( array( ‘key’ => ‘birthday’, ‘compare’ => ‘REGEXP’, // Regular expression explanation: // ^ – Start … Read more

How to get next day date of a specific day

Use the parameters of the shortcode with lowercase: [recurring_event short=”Wed” full=”wednesday”] Try to follow the next code: // NAV: Custom Code function wpcoder_recurring_event_att( $atts ){ $date=””; $default = array( ‘short’ => ‘Sun’, ‘full’ => ‘sunday’ ); $eventday = shortcode_atts($default, $atts); date_default_timezone_set(‘US/Eastern’); if(date(‘D’) == $eventday[“short”]) { echo date(‘F d, Y’); } else { // Create a … Read more

Date not working correctly

What you did wrong here is the part date(‘d’, $rem_days). The function date() should be used to convert timestamp to a formatted date, not to converting a time difference in timestamp to time difference in days. You can fix this by replacing date(‘d’, $rem_days) with floor($rem_days/86400). The complete code should be: $event_date = strtotime( get_field( … Read more

Best Practice for storing aggregate data by date or other criteria?

I settled on using wp_cache_set and wp_cache_get which seems to do well. I create a key based on the class, function, and parameters: $cacheKey = self::createCacheKey( __CLASS__, __FUNCTION__, $referenceYear, $referenceMonth ); createCacheKey() looks like: protected static function createCacheKey( …$args ): string { return implode(‘-‘, $args); } And I’m sure to use an appropriate expiration. For … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduedusedueduseduedueduedusedu