query("SELECT * FROM news_articles WHERE is_featured = TRUE ORDER BY publish_date DESC LIMIT 1"); $featured_article = $featured_stmt->fetch(PDO::FETCH_ASSOC); // Get regular articles (4 most recent non-featured) $articles_stmt = $pdo->query("SELECT * FROM news_articles WHERE is_featured = FALSE ORDER BY publish_date DESC LIMIT 4"); $articles = $articles_stmt->fetchAll(PDO::FETCH_ASSOC); // Get categories for sidebar $categories = $pdo->query("SELECT category, COUNT(*) as count FROM news_articles WHERE category IS NOT NULL GROUP BY category ORDER BY count DESC LIMIT 6")->fetchAll(); ?>
Stay informed about community developments and announcements
= htmlspecialchars(substr($featured_article['content'], 0, 200)) ?>...
= htmlspecialchars(substr($article['content'], 0, 100)) ?>...
Read More