Add Related Posts Before Comments Link in Thesis

Here's a quick tip on how to add Related Posts (or anything else) at the end of a post but before the comments link.

On one of my projects, the client needed a listing of Related Posts and the Add This link to show up below the post's content, but before the Comments link (see the image above).

If you use thesis_hook_after_post, your function appears AFTER the Comments link. So what we need to do is remove the comments link, write a new function that contains Add This, Related Posts, and the Comments link function, and stick that at the end of the post. For the Related Posts, I'm using this plugin .
[php]/* Add This, Related Posts, and Comments */
remove_action('thesis_hook_after_post','thesis_comments_link');
function custom_related_posts() {
if(is_single() || is_front_page()): ?>
[your AddThis.com code]
<?php wp_related_posts();
thesis_comments_link();
endif;
}
add_action('thesis_hook_after_post','custom_related_posts');[/php]

No comments yet