Last active
December 17, 2015 14:48
-
-
Save niklausgerber/5626584 to your computer and use it in GitHub Desktop.
Problem with my footer
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 $article = $pages->find('blog')->children()->last() ?> | |
<?php $second = $article->prev() ?> | |
<?php $third = $second->prev() ?> | |
<div class="footer"> | |
<div class="container"> | |
<div class="grid full"> | |
<h3><?php echo html($article->title()) ?></h3> | |
<small><?php echo html($article->Published()) ?></small> | |
<p><?php echo excerpt($article->text(), 400) ?><a href="<?php echo html($article->url()) ?>"> Continue reading</a></p> | |
</div> | |
<div class="cf"></div> | |
<hr /> | |
<?php if($page->template()!='article') :?> | |
<div id="next" class="grid half"> | |
<p><a href="<?php echo html($second->url()) ?>"><?php echo html($second->title()) ?><br /><small><?php echo excerpt($second->description(), 60) ?></small></a></p> | |
</div> | |
<?php elseif($page->template()=='article' and $page->hasNext()) :?> | |
<div id="next" class="grid half"> | |
<p><a href="<?php echo $page->next()->url() ?>"><?php echo $page->next()->title() ?><br /><small><?php echo excerpt($page->next()->description(), 60) ?></small></a></p> | |
</div> | |
<?php else : ?> | |
<div id="next" class="grid half"> | |
| |
</div> | |
<?php endif ?> | |
<?php if($page->template()!='article') :?> | |
<div id="previous" class="grid half"> | |
<p><a href="<?php echo html($third->url()) ?>"><?php echo html($third->title()) ?><br /><small><?php echo excerpt($third->description(), 60) ?></small></a></p> | |
</div> | |
<?php elseif($page->template()=='article' and $page->hasPrev()) :?> | |
<div id="previous" class="grid half"> | |
<p><a href="<?php echo $page->prev()->url() ?>"><?php echo $page->prev()->title() ?><br /><small><?php echo excerpt($page->prev()->description(), 60) ?></small></a></p> | |
</div> | |
<?php else : ?> | |
<div id="next" class="grid half"> | |
| |
</div> | |
<?php endif ?> | |
<div class="cf"></div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment