Has Wordpress a function or something like that?I need a way to check if there are any page links(Older Entries | Newer Entries)to be displayed or not.
Best Regards,
Has Wordpress a function or something like that?I need a way to check if there are any page links(Older Entries | Newer Entries)to be displayed or not.
Best Regards,
If you look at the new_posts_link function, you'll see a $max_page and $paged vars.
If the $pages is higher to 1, there is a previous page link.
It it's smaller to $max_page, there is a next page link.
So you can do the following functions :
# Will return true if there is a next page
function has_next_page() {
global $paged, $max_page;
return $paged < $max_page;
}
# Will return true if there is a previous page
function has_previous_page() {
global $paged;
return $paged > 1;
}
# Will return true if there is more than one page (either before or after).
function has_pagination() {
return has_next_page() or has_previous_page();
}
Although like many i use the pagenavi plugin by Lester Chan.right http://lesterchan.net/wordpress/readme/wp-pagenavi.html