First, it is a bad idea to edit main template files. It is better to create a child theme and make edits to the main template files.
Second, the next_post_link and prev_post_link functions already functions as navigation buttons to load previous or next posts so I don’t see a real need for rel=”next” or rel=”prev” attributes.
What exactly are you trying to do?
First, I don’t understand why it’d be a bad thing to edit main template files in place—I’ve done so many times without negative effect. (It should be noted, of course, that mine’s an extremely simple-minded template, scavenged from Jeff Starr’s H5, and simplified to the point of only index, functions (few to none) and link to master site css).
Second, yes, I am aware of the intended *use* of the two functions—i.e., providing links to either generic next/previous page in time or specifically the same in a narrowed tag/category search (in the way my template’s defined).
What am I trying to do? Simply, as I said, including the ”rel” text in the said links. That’s all. (Why? Semantics. Css styling.)
[added] The point is, next_posts__link yields html consisting of the *entire* a href=”…” text while next_post_link gives me more granular control over the generated html.
Yes, I understand that. Have you checked this article out?
Yep, I have, and am aware that the meanings of “next” and “prev” are, in effect, reversed. This’ll mean an alteration in the way I define the visible text that goes along with the links in my nav section. However, the topic I’m trying to address here is specifically, the PHP error.
The “next_post_link” function isn’t found. The “next_posts_link” is.
The “previous_post_link” function isn’t found. The “previous_posts_link” is.
Is it impossible to gain access to the “next_post_link”/”previous_post_link” functions via edit-in-place?
It is not possible to access those functions in order to add the rel tags you want through PHP. It can be possible through jQuery as you can consider a generic example of how below:
$('.admin_links_node_edit a').attr('rel', 'lightframe');
…Okay, thanks. I’ll try to figure out how to expand upon your suggestion for my needs (given my puny knowledge of jquery and lightframe). Yep, I know, I know: “read the instructions.” Thanks again. Really. 🙂
Oh, the lighframe is just the value for the rel attribute. In your case, it would be something like:
$('.prev-link a').attr('rel', 'prev');
You are welcome. 🙂