This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get days with posts | |
$dayswithposts = $wpdb->get_results("SELECT (FROM_UNIXTIME(`wp_postmeta`.`meta_value`,'%d')) as dom , | |
`wp_postmeta`.`post_id` , `wp_posts`.`guid` , `wp_posts`.`post_title` | |
FROM $wpdb->postmeta | |
LEFT JOIN `wp_posts` ON `wp_postmeta`.`post_id` = `wp_posts`.`ID` | |
WHERE `wp_postmeta`.`meta_key` = 'event_startdate' | |
AND `wp_posts`.`post_status` = 'publish' | |
AND `wp_postmeta`.`meta_value` >= UNIX_TIMESTAMP( '{$thisyear}-{$thismonth}-01 00:00:00' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get days with posts | |
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date) | |
FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' | |
AND post_type = 'post' AND post_status = 'publish' | |
AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N); | |
if ( $dayswithposts ) { | |
foreach ( (array) $dayswithposts as $daywith ) { | |
$daywithpost[] = $daywith[0]; |
NewerOlder