selder2
Member
Posted 5 years ago #
I need to do something like this:
<?php
$navavailable == next_posts_link('« 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?
Try:
<?php
if ( !get_next_post() )
{ ... }
?>
selder2
Member
Posted 5 years ago #
Seriously! that worked! (without the ! though)
"without the ! though"
Oops. Misread your code. It was a long day yesterday...
selder2
Member
Posted 5 years ago #
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('« Previous Entries');
echo "</div>";
echo "<div class=\"alignright\">";
echo previous_posts_link('Next Entries »');
echo "</div>";
echo "</div>";
}; ?>