idiotboy
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Checking if there are next postsok – got it working now:
I copied the two functions responsible for generating the links – next_posts_link and previous_posts_link and renamed them has_next_posts and has_previous_posts. Then replaced the bit where it echoes its output with –
return true
else return falseSo now i can go –
if (has_next_posts || has_previous_posts) {
//put nav block in
}I was confused a bit coz there is a function named ‘next_post_link’ and ‘next_posts_link’ and I was looking at the wrong one.
Thanks for the help viper and alphaoide.
Forum: Fixing WordPress
In reply to: Checking if there are next postsnope – i assume those functions u mention return true or false if the post has a next or previous post. What we want is a function that returns true or false if the current page of posts has a previous or next page of posts.
Forum: Fixing WordPress
In reply to: Checking if there are next postsI tried the exact same ‘gee I hope this works!’ code. No go. I know what you mean – at the moment either the nav links are there when required or there is a big gap when there arent any other pages to navigate to. Need a function to ask wether there is a next or previous page to navigate to so the navigation space is only written when necessary.