I must be a troublemaker. I have run into roughly the same problem with posts_nav_link() as I did with the_content().
Unfortunately, my hackery didn’t work quite as well this time. My markup validates now, but I’ve got a bogus next-link that doesn’t belong there (when there actually isn’t a next
page to go to). I will have to do substantially more poking at the WordPress code to fix it, since a cursory glance wasn’t enough for me to understand what’s going on.
You know, I hate that I’m solving these problems by adding more parameters to tags. I think that in terms of overall design, WordPress should lean more towards simple tags that return a simple, un-marked-up string (in this case, a URL and let the markup be customized outside the tag. It would make life so much simpler for me, and the code would be simpler too.
Then again, maybe I’m just missing something completely obvious.
Dorothea Salo says:
No, you're completely right. DSpace has a lot of the same problems, only writ large. If they'd just return DATA instead of a metric you-know-whatload of lousy HTML, I'd be a much happier person.
Laurabelle says:
Yay for not missing something completely obvious.
I think I'm going to have to do some hackery and create a couple of tags that just return the URL, because I get bogus links where they shouldn't be. Grrr. I am going to see whether this can be done with a plugin; otherwise I'll just have to modify the main code even more deeply.
Pah.
Laurabelle says:
Ha! Spoke too soon. A simple test for an empty string solved that particular problem.
I will have to play around more and figure out how easily it would be to create functions to return simple data (as you call it, Dorothea). I would rather not rewrite every single function in WordPress.
Elliott says:
Hi Laurabelle... I'm wondering if you found anything to fix ur bogus "Next" link... I've got the same issue, except with "Previous Posts" showing up when it shouldn't. I'm at a total loss as to why it's happening...