EDIT
单件。您应该使用的php:
<?php previous_post_link(\'%link\', \'Previous\'); ?>
和
<?php next_post_link(\'%link\', \'Next\'); ?>
. 然后将其添加到函数中。php:
function filter_next_post_link($link) {
$link = str_replace("rel=", \'class="next" rel=\', $link);
return $link;
}
add_filter(\'next_post_link\', \'filter_next_post_link\');
function filter_previous_post_link($link) {
$link = str_replace("rel=", \'class="prev" rel=\', $link);
return $link;
}
add_filter(\'previous_post_link\', \'filter_previous_post_link\');
虽然这不是这个问题的答案,但要在分类中分页,您应该进行研究
next_posts_link_attributes
和
previous_posts_link_attributes
挂钩。只需将此添加到您的函数中。php:
function next_posts_link_css($content) {
return \'class="next"\';
}
function previous_posts_link_css($content) {
return \'class="prev"\';
}
add_filter(\'next_posts_link_attributes\', \'next_posts_link_css\' );
add_filter(\'previous_posts_link_attributes\', \'previous_posts_link_css\' );
我只是想澄清一下。您将在模板文件中使用常规分页:
<?php previous_posts_link(\'Previous\') ?>
<?php next_posts_link(\'Next\') ?>