Change Next and Previous Post Text in Thesis

At the bottom of your posts is a link to the previous and next post. This quick tip will show you how to change that.

The Previous Post and Next Post links are generated by the function thesis_prev_next_posts(). So to change the text, we'll remove that function, create a custom function that duplicates it (but with our modifications), and then add it back where the original function was. In this example I'm going to change "Previous Post / Next Post" to just "Previous / Next" (see the bold text).

function custom_prev_next_posts() {
global $thesis;
if (is_single() && $thesis['display']['posts']['nav']) {
$previous = get_previous_post();
$next = get_next_post();
if ($previous || $next) {
echo '<div class="prev_next post_nav">' . "\n";
if ($previous) {
if ($previous && $next)
$add_class = '';
echo '<p class="previous" >' . __('Previous:', 'thesis') . ' ';
previous_post_link('%link', '%title');
echo '</p>' . "\n";
}
if ($next) {
echo '<p>' . __('Next:', 'thesis') . ' ';
next_post_link('%link', '%title');
echo '</p>' . "\n";
}
echo '</div>' . "\n";
}
}
}
remove_action('thesis_hook_after_content','thesis_prev_next_posts');
add_action('thesis_hook_after_content','custom_prev_next_posts');

No comments yet