I've got another question regarding next / previous post.
At the moment I'm working on our portfolio with several items. Each item is a post with a title, category & featured image. When viewing an item there are 4 next/previous posts.
How do I display the next 2 and previous 2? And If the next or previous don't exist how do I show only 4 previous or 4 next posts (at the first and last post)?
Currently I'm using twitter bootstrap CSS/HTML:
<div class="row-fluid tab-footer">
<div class="span3">
<div class="row-fluid none">
<div class="span3">THUMBNAIL</div>
<div class="span9" ><h2>TITLE</h2>
<p><?php
foreach((get_the_category()) as $childcat) {
if (cat_is_ancestor_of(3, $childcat)) {
echo '<a href="'.get_category_link($childcat->cat_ID).'">';
echo $childcat->cat_name . '</a> ';
}}
?>
</p>
</div>
</div>
<div class="span3 hidden-phone">
<div class="row-fluid none">
<div class="span3">THUMBNAIL</div>
<div class="span9" ><h2>TITLE</h2>
<p>CATEGORY</p>
</div>
</div>
<div class="span3 hidden-phone">
<div class="row-fluid none">
<div class="span3">THUMBNAIL</div>
<div class="span9" ><h2>TITLE</h2>
<p>CATEGORY</p>
</div>
</div>
<div class="span3">
<div class="row-fluid none">
<div class="span3">THUMBNAIL</div>
<div class="span9" ><h2>TITLE</h2>
<p>CATEGORY</p>
</div>
</div>
</div>