only show container with next/prev links if they exist?

hey guys,
i know there is something like
if ( function_exists('')

is it possible to use that with next_posts_link() and previous_posts_link().

Read More

The reason I’m asking that is that I have something like

<div class="navigation">
    <div class="next-posts"><?php next_posts_link('&laquo; older') ?></div>
    <div class="prev-posts"><?php previous_posts_link('newer &raquo;') ?></div>
</div>

In my case div.navigation has a colored background and a fixed height. So even there is no next or perv post this div.navigation appears. I wonder if I can only display this if there exists a next or prev post?

Any idea how to do that?

Related posts

Leave a Reply

3 comments

  1. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
    <div class="navigation">
        <div class="next-posts"><?php next_posts_link('&laquo; older') ?></div>
        <div class="prev-posts"><?php previous_posts_link('newer &raquo;') ?></div>
    </div>
    <?php endif; ?>