Showing all posts from different folders (merging collections)

If all posts have the same template you could use this:

$posts = $site->index()->filterBy('template', 'YOURTEMPLATE')

Otherwise you could merge two collections like this:


<?php
  $posts_a = $site->find('a')->children();
  $posts_b = $site->find('b')->children();
  $posts = new Pages(array($posts_a, $posts_b));
?>

Found here: Merge Collection of Pages

1 Like