i tried this :
<?php $prev=get_previous_posts_link();
if (strlen($prev) == 0)
{
echo "no posts";
}
else
{
echo $prev;
}
?>
it always returns no posts!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The code you use should be placed within the loop.
ie. inside,
Your code might not be inside the loop and it could be the only reason why it always return no posts!