';
}
/* 8) Page virtuelle : on rend un layout propre quand ?mwg_daily=... est présent */
add_action('template_redirect', function(){
if (is_admin()) return;
$date = mwg_daily_get_date();
if (!$date) return;
// Marquer comme page OK (pas 404)
global $wp_query;
status_header(200);
$wp_query->is_404 = false;
// Contenu
$pretty = mwg_daily_pretty_date($date);
$q = mwg_daily_query($date);
get_header();
echo '';
echo '';
echo '
Daily Answers for '.esc_html($pretty).'
';
if ($q->have_posts()){
mwg_render_daily_list($q);
} else {
echo '
No daily answers were published on '.esc_html($pretty).'.
';
}
mwg_daily_nav($date);
echo '';
echo '';
get_footer();
exit;
});
/* 9) CALENDRIER — jours sans contenu NON cliquables + classes cohérentes avec le CSS */
function mwg_month_posts_by_day($year, $month){
// Retourne un set [jour => true] pour les jours ayant au moins un post
$start = sprintf('%04d-%02d-01', $year, $month);
$endTs = strtotime($start.' +1 month -1 day');
$q = new WP_Query([
'post_type' => 'post',
'posts_per_page' => -1,
'date_query' => [[
'after' => $start.' 00:00:00',
'before' => wp_date('Y-m-d 23:59:59', $endTs),
'inclusive' => true,
]],
'fields' => 'ids',
'no_found_rows' => true,
]);
$days = [];
foreach ($q->posts as $pid){
$d = get_the_date('j', $pid);
$days[(int)$d] = true;
}
return $days;
}
function mwg_render_calendar($year = null, $month = null){
$tz = wp_timezone();
$todayYmd = wp_date('Y-m-d', time(), $tz);
if (!$year) $year = (int) wp_date('Y', time(), $tz);
if (!$month) $month = (int) wp_date('n', time(), $tz);
$firstTs = strtotime(sprintf('%04d-%02d-01', $year, $month));
$daysInMonth = (int) wp_date('t', $firstTs, $tz);
$startDow = (int) wp_date('N', $firstTs, $tz); // 1=lundi
$hasMap = mwg_month_posts_by_day($year, $month);
echo '
';
// en-têtes jour
$dows = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];
foreach ($dows as $d) {
echo '
'.esc_html($d).'
';
}
// cellules vides avant le 1er
for ($i=1; $i<$startDow; $i++){
echo '';
}
// jours
for ($day=1; $day <= $daysInMonth; $day++){
$ymd = sprintf('%04d-%02d-%02d', $year, $month, $day);
$isToday = ($ymd === $todayYmd);
$hasPosts = !empty($hasMap[$day]);
$classes = ['mwg-cal-day'];
if ($hasPosts) $classes[] = 'has-posts';
if ($isToday) $classes[] = 'is-today';
$classAttr = esc_attr(implode(' ', $classes));
if ($hasPosts){
// cliquable uniquement si posts
$url = add_query_arg('mwg_daily', $ymd, home_url('/'));
echo ''.$day.'';
} else {
// NON cliquable
echo '
'.$day.'
';
}
}
echo '
'; // .mwg-cal-grid
}
Churn Crossword Clue - My Word GamesSkip to content
Churn Crossword Clue
by
Hi There,
We would like to thank for choosing this website to find the answers of Churn Crossword Clue which is a part of The New York Times “03 16 2023” Crossword.
The Author of this puzzle is Rebecca Goldstein.
Do not hesitate to take a look at the answer in order to finish this clue.
Churn Answer :
The answer is :
ROIL
You can now comeback to the master topic of the crossword to solve the next one where you are stuck : NYT Crossword Answers.