-
-
Save starckio/f2c536cef4905a603d44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$blogs = $pages->findByUID('blog1', 'blog2'); | |
$articles = $blogs->children()->sortBy('date', 'desc'); | |
// if you want you can add a limit or pagination to that set of articles | |
// afterwards just use a regular foreach loop to go through them all. | |
?> | |
<?php foreach($articles as $article): ?> | |
<article> | |
<?php if($article->template() == 'article.text'): ?> | |
<!-- put the HTML for the text post here --> | |
<?php elseif($article->template() == 'article.video'): ?> | |
<!-- put the HTML for the video post here --> | |
<?php elseif($article->template() == 'article.image'): ?> | |
<!-- put the HTML for the image post here --> | |
<?php elseif($article->template() == 'article.link'): ?> | |
<!-- put the HTML for the link post here --> | |
<?php elseif($article->template() == 'article.quote'): ?> | |
<!-- put the HTML for the quote post here --> | |
<?php endif ?> | |
</article> | |
<?php endforeach ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment