Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php use_helper('Pager');
- $pager = new Pager(array( 'style' => 'classic', 'items_per_page' => 3, 'total_items' => $this->childrenCount())); ?>
- <?php // $last_articles = $this->children(array('limit'=>5, 'order'=>'page.created_on DESC')); ?>
- <?php $last_articles = $this->children(array('limit' => $pager->items_per_page, 'offset' => $pager->sql_offset, 'order'=>'page.created_on DESC')); ?>
- <?php foreach ($last_articles as $article): ?>
- <div class="entry">
- <h3><?php echo $article->link($article->title); ?></h3>
- <?php if (($more_pos = strpos($article->content(), '<!--more-->')) === false ) {
- // "more" trigger NOT found, so just echo content
- echo $article->content();
- } else {
- // "more" trigger IS found, so echo only teaser and add link to whole article
- echo substr($article->content(), 0, $more_pos);
- echo '</p><p>'. $article->link('Read more...') .'</p>';
- } ?>
- <p class="info">Posted: <?php echo $article->date(); ?> | Tags: <?php echo tag_links($article->tags()); ?></p>
- </p>
- </div>
- <?php endforeach; ?>
- <?php echo $pager; ?>
Add Comment
Please, Sign In to add comment