• I need to do something like this:

    <?php
    $navavailable == next_posts_link('&laquo; Previous Entries');
    if ($navavailable != "")
    { ... }
    ?>

    But as I thought, the code in the if statement is displayed . Is there any way to check if there are ‘previous entries’ using that wordpress tag?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try:

    <?php
    if ( !get_next_post() )
    { ... }
    ?>

    Thread Starter selder2

    (@selder2)

    Seriously! that worked! (without the ! though)

    without the ! though

    Oops. Misread your code. It was a long day yesterday…

    Thread Starter selder2

    (@selder2)

    Mmm … I got it working when I posted my previous reply, and I’m sure I wasn’t dreaming or looking somewhere wrong!

    But now it doesn’t work anymore, and I don’t know what is causing it! Darn!

    Here is my code (which is not displayed at all now)


    <?php
    if (get_next_post())
    {
    echo "<div class=\"navigation\">";
    echo "<div class=\"alignleft\">";
    echo next_posts_link('&laquo; Previous Entries');
    echo "</div>";
    echo "<div class=\"alignright\">";
    echo previous_posts_link('Next Entries &raquo;');
    echo "</div>";
    echo "</div>";
    }; ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Check if there are previous entries’ is closed to new replies.