Enter your keyword

4 Different Ways To Change Previous And Next Links In Thesis

4 Different Ways To Change Previous And Next Links In Thesis

By default, Thesis has the option to feature previous/next post links on single entry pages. You can activate or deactivate this option through the Thesis Options panel on your WordPress Dashboard. Here’s the code that is controlling how it looks in the picture above.


.prev_next {
border-style:solid;
color:#666666;
letter-spacing:1px;
text-transform:uppercase;
}

.prev_next a {
text-decoration: none;
}

.prev_next a:hover {
text-decoration: underline;
}

I can style this section with CSS to make it look different. Here are some examples.

  1. Make the previous and next links appear on different sides of the page.

    To get the above effect, add the following code to custom.css.

    .custom div.prev_next p {
    float:right;
    }

    .custom div.prev_next p.previous {
    float:left;
    }

  2. Change the color of the text to match the links. If I want the text to match my links, I can change the color code in the above css.
    .prev_next {
    border-style:solid;
    color:#ff6600;
    letter-spacing:1px;
    text-transform:uppercase;
    }
  3. Move the links to before the post on single post pages. If I want to move the posts around, I can insert some code into custom_functions.php as follows:

    remove_action('thesis_hook_after_content', 'thesis_prev_next_posts');
    add_action('thesis_hook_before_content', 'thesis_prev_next_posts');

  4. Remove the previous/next links on the home page only. You can remove the previous and next links through the Thesis Options Panel, but if you want to remove them from the home page *only*, insert this code into custom_functions.php:


    function no_home_post_nav() {
    if (is_home())
    remove_action('thesis_hook_after_content', 'thesis_post_navigation');
    }
    add_action('thesis_hook_before_content','no_home_post_nav');

Comments (3)

  1. May 21, 2010

    Thank you so much for this tutorial. I was thinking of using a plug-in but with the Thesis theme, it’s a whole new ballpark! So I’m grateful for finding this post from you.

    Much appreciated!
    Thu

  2. Ken
    May 25, 2010

    Any idea how to change the text of ‘Previous Post’ to other verbage? More importantly, what if we wanted to only navigate with the category of that post.

  3. Dec 19, 2010

    Hello.
    i have the same problem – i want to change the text “previous post” to a different text.
    how do i do that ?

Post a Comment

Your email address will not be published.