This post has been marked as old. The code might no longer work. Comments have been disabled as this is no longer maintained. Use the search on the right to find a newer tutorial.
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');
Darcy Scott says
Thanks for this. But in which file do we make these modifications?
Bill Erickson says
All customizations to Thesis should go in /custom/custom_functions.php
Darcy Scott says
Thank you again.
Pshemko says
It doesn’t work on my site. The links are gone.
Heureux says
thanks for this post
any idea of how to change the place of previous and next post on the page?
i find weaver theme placement much much better and I’d like to have the same
thanx
Bill Erickson says
Take a look at this tutorial on DIYThemes: http://diythemes.com/thesis/rtfm/move-previous-next-links/
You’ll need to remove it from its current location, then add it somewhere else. Ex:
remove_action(‘thesis_hook_after_content’, ‘thesis_prev_next_posts’);
add_action(‘thesis_hook_before_content’, ‘thesis_prev_next_posts’);