You can use a custom function to add arguments to the links. Here is the code for the function:
function mam_add_query_arg ($key,$value,$link) {
// Adds the parameter $key=$value to $link, or replaces it if already there.
// Necessary because add_query_arg fails on previous/next_post_link.
if (strpos($link,'href')) {
$hrefpat = '/(href *= *([\"\']?)([^\"\' ]+)\2)/';
} else {
$hrefpat = '/(([\"\']?)(http([^\"\' ]+))\2)/';
}
if (preg_match($hrefpat,$link,$matches)) {
$url = $matches[3];
$newurl = add_query_arg($key,$value,$url);
// echo '<p>OLDURL:' . htmlspecialchars($url) . '</p>';
// echo '<p>NEWURL:' . htmlspecialchars($newurl) . '</p>';
$link = str_replace($url,$newurl,$link);
}
return $link;
}
Then replace the call to next_posts_link() like this:
echo mam_add_query_arg( 'mykey','myvalue',get_next_posts_link());
Do the same for previous_posts_link().
Be sure to put the correct arguments to the previous/next_posts_link() calls!