2026 Calendar: Events & Holidays Overview

function calendar_2026_advanced_shortcode() {
$year = 2026;
// 🔹 EVENTS (edit these)
$events = [
'2026-01-15' => 'Board Meeting',
'2026-03-20' => 'AGM',
'2026-06-01' => 'Club Opens',
'2026-07-01' => 'Canada Day Celebration',
'2026-09-05' => 'Fall Regatta',
'2026-12-31' => 'New Year’s Eve Party',
];
// 🔹 HOLIDAYS (highlighted)
$holidays = [
'2026-01-01' => 'New Year’s Day',
'2026-07-01' => 'Canada Day',
'2026-12-25' => 'Christmas Day',
];
$months = [
1=>'January',2=>'February',3=>'March',4=>'April',
5=>'May',6=>'June',7=>'July',8=>'August',
9=>'September',10=>'October',11=>'November',12=>'December'
];
ob_start(); ?>
<style>
.calendar-2026 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
gap: 20px;
font-family: Arial, sans-serif;
}
.calendar-month {
border: 2px solid #004c7f;
border-radius: 6px;
padding: 10px;
}
.calendar-month h3 {
text-align: center;
background: #004c7f;
color: #fff;
padding: 8px;
margin: -10px -10px 10px;
}
.calendar {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.calendar th, .calendar td {
border: 1px solid #ccc;
padding: 6px;
vertical-align: top;
}
.calendar th {
background: #e9f2f9;
}
.calendar td a {
text-decoration: none;
color: #004c7f;
font-weight: bold;
}
.event {
display: block;
font-size: 11px;
margin-top: 4px;
background: #e6f4ff;
padding: 2px;
border-radius: 3px;
}
.holiday {
background: #ffe5e5 !important;
}
@media print {
.calendar-2026 {
grid-template-columns: repeat(2, 1fr);
}
.calendar-month {
page-break-inside: avoid;
}
}
</style>
<div class="calendar-2026">
<?php foreach ($months as $monthNum => $monthName):
$firstDay = date('w', strtotime("$year-$monthNum-01")); // Sunday start
$daysInMonth = cal_days_in_month(CAL_GREGORIAN, $monthNum, $year);
?>
<div class="calendar-month">
<h3><?php echo "$monthName $year"; ?></h3>
<table class="calendar">
<tr>
<th>Sun</th><th>Mon</th><th>Tue</th>
<th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th>
</tr>
<tr>
<?php
for ($i=0; $i<$firstDay; $i++) {
echo '<td></td>';
}
for ($day=1; $day<=$daysInMonth; $day++) {
$date = sprintf('%04d-%02d-%02d',$year,$monthNum,$day);
$classes = [];
if (isset($holidays[$date])) {
$classes[] = 'holiday';
}
echo '<td class="'.implode(' ',$classes).'">';
echo '<a href="?date='.$date.'">'.$day.'</a>';
if (isset($events[$date])) {
echo '<span class="event">'.$events[$date].'</span>';
}
if (isset($holidays[$date])) {
echo '<span class="event">'.$holidays[$date].'</span>';
}
echo '</td>';
if ((($day + $firstDay) % 7) == 0) {
echo '</tr><tr>';
}
}
$remaining = (7 - (($daysInMonth + $firstDay) % 7)) % 7;
for ($i=0; $i<$remaining; $i++) {
echo '<td></td>';
}
?>
</tr>
</table>
</div>
<?php endforeach; ?>
</div>
<?php
return ob_get_clean();
}
add_shortcode('calendar_2026', 'calendar_2026_advanced_shortcode');