previous_post
and next_post
are deprecated. you should be using previous_post_link
and next_post_link
. That function applies the {$adjacent}_post_link
filter. You can use that to get what you want. A very, very crude example:
function construct_np_attr_wpse_92086($matches) {
if ('prev' == $matches[1]) {
$np = 'Previous';
} else {
$np = 'Next';
}
$ret="rel="".$matches[1].'" class="normalTip" ';
if (!empty($np)) {
$ret .= 'title="'.$np.' Project"';
}
return $ret;
}
function add_attr_to_np_links_wpse_92086($link) {
return preg_replace_callback('/rel="([^"]+)"https://wordpress.stackexchange.com/",'construct_np_attr_wpse_92086',$link);
}
add_filter('next_post_link','add_attr_to_np_links_wpse_92086');
add_filter('previous_post_link','add_attr_to_np_links_wpse_92086');