getMonthlyArchives();
// Basic styles or structure:
echo '
';
echo '
Archives
';
if (!empty($archives)) {
echo '
';
foreach ($archives as $row) {
$yearMonth = $row['year_month']; // e.g. "2024-11"
$year = $row['year'];
// Convert numeric month to a textual representation, e.g., November
// Or you can keep it numeric if you prefer
$monthNum = (int)$row['month']; // "11" => 11
$monthLabel = date('F', mktime(0, 0, 0, $monthNum, 1, $year));
$total = $row['total'];
// Build a link, e.g. /HOME_DIRECTORY/index.php?url=post/archive/2024-11
// or /post/archive/2024-11 if you have a custom .htaccess
$archiveUrl = HOME_DIRECTORY . 'index.php?url=post/archive/' . htmlspecialchars($yearMonth);
echo '