Genesis Framework

如何更改Genesis 文章分页导航文字

Genesis Theme Framework的Genesis Theme Settings中提供了三种文章导航(Post Navigation)方式:
Older/Newer,
Prev/Next,
Numeric
Older/Newer的方式默认的文字是<<Older Posts和Newer Posts>>,这对博客网站很使用,如果换成产品评论网站,似乎改成Older Reviews和Newer Reviews更合适。

Older / Newer Post Navigation Filter

如果Genesis Theme Settings->Content Archives->Select Post Navigation Technique设置为Older/Newer,则改导航方式生效,在子模板的functions.php中添加如下代码,可以将posts修改为reviews

add_filter('genesis_older_link_text', 'gt_review_older_link_text');
function gt_review_older_link_text() {
    $olderlink = '&laquo; Older Reviews';
    return $olderlink;
}

add_filter('genesis_newer_link_text', 'gt_review_newer_link_text');
function gt_review_newer_link_text() {
    $newerlink = 'Newer Reviews &raquo;';
    return $newerlink;
}

Previous / Next Post Navigation Filter

如果Genesis Theme Settings->Content Archives->Select Post Navigation Technique设置为Previous/Next,则改导航方式生效,在子模板的functions.php中添加如下代码,可以将文字改为Previous Reviews/Next Reviews

add_filter('genesis_prev_link_text', 'gt_review_prev_link_text');
function gt_review_prev_link_text() {
    $prevlink = '&laquo; Previous Reviews';
    return $prevlink;
}

add_filter('genesis_next_link_text', 'gt_review_next_link_text');
function gt_review_next_link_text() {
    $nextlink = 'Next Reviews &raquo;';
    return $nextlink;
}

每个细节的改善都能给客户带来更好的体验,注重细节。