End of blog roll or start of blog roll, _post_link = false / no link

Please help, how do you write this

if next_post_link() = false / no link or end of blog roll :
 do this;
else :
 return;
endif;

Topic php Wordpress

Category Web


I think you're just having an issue with the if next_post_link() = false part? If so and you want to know if the current post has a next post (link), you can use get_next_post_link() or get_next_post() like so: (the echo are just examples, so just replace that with your very own code)

if ( ! get_next_post_link() ) { // use this
//if ( ! get_next_post() ) {    // or this
    echo 'do this';
} else {
    echo 'return';
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.