Page 1 of 1

Showing Particular Category Contents

Posted: Sun Jul 03, 2022 5:44 pm
by guleyc
Hi,

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>";
        }
	?>
How can I list maximum 4 posts in my homepage and using paginator?

Re: Showing Particular Category Contents

Posted: Sun Jul 03, 2022 7:34 pm
by Edi
guleyc wrote: Sun Jul 03, 2022 5:44 pm I have some static pages, but I want to create a blog additionaly.
This is explained in the documentation:

https://docs.bludit.com/en/content/content-basics
How can I list maximum 4 posts in my homepage and using paginator?
This can be set at "Settings" > "General" > "General" > "Items per page".