Showing Particular Category Contents

Post Reply
guleyc
Jr. Bludit
Posts: 7
Joined: Sun Jul 03, 2022 3:29 pm

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?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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".
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply