I'm writing a theme for bludit. I have some static pages, but I want to create a blog additionaly.
I'm seperating posts via categories. I want to show blog posts in my homepage.
Code: Select all
<?php
$categoryKey = 'blog';
$category = getCategory($categoryKey);
?>
<?php foreach ($category->pages() as $pageKey) {
echo "<div class='entry p1 anim-i'>";
$page = new Page($pageKey);
echo "<div class='entry-title'><h2>".$page->title()."</h2></div>";
echo "<div class='entry-description mb1'>".$page->description()."</div>";
$link_address = $page->permalink();
echo "<a class='db' href='$link_address'>Read More</a>";
echo "</div>";
}
?>