daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Sep 24th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php snippet('header') ?>
  2. <?php snippet('menu') ?>
  3. <?php
  4.  
  5. if(param('tag')) {
  6.  
  7.   $articles = $pages->find('blog')
  8.                     ->children()
  9.                     ->visible()
  10.                     ->filterBy('tags', param('tag'), ',')
  11.                     ->flip()
  12.                     ->paginate(10);
  13.  
  14. } else {
  15.  
  16.   $articles = $pages->find('blog')
  17.                     ->children()
  18.                     ->visible()
  19.                     ->flip()
  20.                     ->paginate(10);
  21.  
  22. }
  23.  
  24. ?>
  25.  
  26.  
  27. <section class="content blog">
  28.  
  29.   <h1><?php echo html($page->title()) ?></h1>
  30.   <?php echo kirbytext($page->text()) ?>
  31.  
  32. <!-- FOR EACH LOOP BEGIN -->
  33.   <?php foreach($articles as $article): ?>
  34.   <article>
  35.     <h1><?php echo html($article->title()) ?></h1>
  36.     <p><?php echo excerpt($article->text(), 300) ?></p>
  37.     <a href="<?php echo $article->url() ?>">Read moreā€¦</a>
  38.     <?php echo $article->tags() ?>
  39.   </article>
  40.  
  41.   <?php endforeach ?>
  42. <!-- FOR EACH LOOP END -->
  43.  
  44. <hr/>
  45. <hr/>
  46. <!-- CLICKABLE TAG CLOUD GENERATOR -->
  47. <?php $tagcloud = tagcloud($pages->find('blog'), array('limit' => 20)) ?>
  48. <ul>
  49. <?php foreach($tagcloud as $tag): ?>
  50.   <li><a href="<?php echo $tag->url() ?>"><?php echo $tag->name() ?></a></li>
  51. <?php endforeach ?>
  52. </ul>
  53.  
  54.  
  55.  
  56. <hr/>
  57. </section>
  58.  
  59. <?php snippet('footer') ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top