Show previous/next only when there is a previous/next page : <p>I am trying to get a pagination on the <code>index.php</code> working. What I come up with yet looks something like this:</p>

<pre><code>&lt;nav&gt;
  &lt;a href="&lt;?php previous_posts(); ?&gt;" class="btn prev-page"&gt;Previous Page&lt;/a&gt;
  &lt;a href="&lt;?php next_posts(); ?&gt;" class="btn next-page"&gt;Next Page&lt;/a&gt;
&lt;/nav&gt;
</code></pre>

<p>However, I'd like to show the Previous/Next buttons only, when there actually exists a previous/next page. How can I achieve that?</p>

<p>Thanks!</p>
