get_results( "SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, COUNT(*) AS count FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY year DESC, month DESC" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery if (empty($rows)) { echo '
' . esc_html__('暂无文章。', 'aksrt') . '
'; return; } $current_year = 0; $shown = 0; ?>
year !== $current_year) : $current_year = (int) $row->year; ?>

month, (int) $row->count)); ?>

0 && $shown >= $limit) { break; } ?>