You are here: Computer Video TutorialThesis TutorialAdd Related Posts in Thesis Theme Without Widget

Add Related Posts in Thesis Theme Without Widget

by Kimi on October 23, 2010

“Related Posts” if you are using Thesis 1.8 without plugins.

I know, i have posted many wordpress tips to avoid using plugins.

I have a reason to do this, plugins can slow down your site, this is why it is very important to only using the most important plugins to suit your need.

In this tutorial, by using Thesis 1.8, we are going to display or echo out the related post shortcode based on post tags, so that we don’t have to type it everytime we want to display.

If you use another theme or want to use widget, i have made this related post wordpress tutorial a few days ago.

End Result.

Video:

Steps:

1. In your admin page, go to “Thesis” options → “Custom File editor”

2. Select Custom_functions.php file.

3. Download this .txt shortcode code, copy all the content and paste it right in the bottom of custom_functions.php

Note: Editing custom_functions.php can cause error, but you can fix it via cPanel or webserver.

blog seo

4. Click “Big a** Save Button” :D

5. Now, we have to echo out that shortcode function. In the bottom of custom_functions.php (or after the code that you pasted from step 3)

More info see: http://diythemes.com/thesis/rtfm/insert-ad-after-content/

add this code:

function single_post_relatedpost() {
if (is_single()) { ?>
<h3>Related Posts:</h3>
<?php echo do_shortcode("[related_posts]"); ?>
<?php }
}
add_action('thesis_hook_after_post', 'single_post_relatedpost');

6. Refresh your blog post, it should have related posts section now :D

Subscribe new tips via Email:

Was the post helpful? Share it to help others with:

{ 22 comments… read them below or add one }

Rahul @ MazaKaro October 23, 2010 at 4:14 pm

I think the problem is that you have a lot of preferred plugins but
unfortunately these plugins affect website speed greatly but in the same time you cannot work with it . But i think this thesis is very
useful . I’ll try it

very nice post
thank you

Reply

Kimi October 25, 2010 at 8:34 am

Absolutely, plugin usage will slow down the site, i know there are tons of attempting plugin..lol

But i keep my plugin to minimum at the moment too. Especially i have many advertisements, those need times too to load.

Reply

Sayed October 23, 2010 at 5:20 pm

Hey Kimi,

I agree with you on keeping the amount of Plugins to a minimum because the more you have, the bigger chance your blog will produce errors.

And it was thanks to you that I stopped using “SexyBookmarks” because after you said it slowed down your blog I did some tests and you were right my blog was way faster in loading without that Plugin activated.

Thanks for sharing Kimi. :)

Reply

Kimi October 25, 2010 at 8:35 am

You’re welcome Sayed!

I always installed some plugin to try and in the next weeks i removed them too, just like you :D

We have to try them, otherwise, we would never know.
Thanks for visiting.

Reply

Bestofblogger October 24, 2010 at 12:59 am

Thank you for informative post. Related post is good for post navigation for visitors. But my question is, how can we put adsese codes top of related posts?

Reply

Kimi October 25, 2010 at 8:38 am

You can just add adsense code manually on the top of related post.

Perhaps there are some plugins which can do that out there, do some google reasearches.

I don’t use plugin, i actually add the ads manually.

Reply

Edille October 31, 2010 at 12:43 pm

I have hard time searching for code for related posts, but when I see your site, it helps me alot. tnx

the steps not helping me. but the video help me alot ^_^

keep it up.

Now my site have related posts ^_^ yepee!!!!

Reply

Kimi October 31, 2010 at 5:14 pm

Hey Edille,

Mabuhay :) Yes, i checked your site, it has related posts on it :) Don’t forget to always give tags on your posts, so they will relate to each other.

You have an awesome blog, good luck with it!

Cheers.

Reply

SonDan November 22, 2010 at 7:59 am

I would love to use something like this since the YAARP plug-in that I was using started to cause my blog to crash when I upgraded to Thesis 1.8.

But I need my related posts selected by categories and not tags.

How could I change the code to do this please?

Thanks for reading.

Reply

Kimi November 22, 2010 at 4:20 pm

Hi there,

Yes, there is a way for related post based on category, read: http://wpengineer.com/1476/related-posts-on-category/

For reference.

Good luck!

Reply

SonDan November 23, 2010 at 3:58 am

Thanks for the link Kimi. I appreciate you taking time out to reply.

I will read up on it this holiday weekend. All the best.

Reply

Kimi November 23, 2010 at 10:20 am

No problem, SonDan, good luck.

Reply

LiewZY January 11, 2011 at 12:54 pm

The last part:

The “[ related_post]” found additional space before “r” cause the script did not work.

Reply

Kimi January 12, 2011 at 11:11 am

Hi there,

Thank you so much for the catch up, i have updated the post.

Cheers!

Kimi.

Reply

rohan January 24, 2011 at 5:24 am

thanks this helps a lot :) it also helps to have another module besides the related posts within the same window, like a subscribe box or share box so the box looks wholesome :)

Reply

Kimi January 24, 2011 at 11:11 am

Yep :-)

Reply

Chung January 31, 2011 at 6:15 am

Thanks for updating the video..you just saved me some time researching and doing trial and error.

Reply

Kimi January 31, 2011 at 7:31 am

You’re most welcome Chung!

Best regards,

Kimi.

Reply

Greg April 15, 2011 at 10:16 pm

Thanx for your help and this great post ! I love Thesis.

Reply

David Egan June 8, 2011 at 6:37 pm

Thanks very much for this tutorial: clear instructions, no mistakes in the code…I had related posts working within 10 minutes without a plugin!
Thanks again for sharing and well-done!

Reply

Roland Cutter June 24, 2011 at 3:22 pm

Appreciate the Thesis tutorial and any others that you can give. Very clear instructions and I still quite grasp the whole “hooks” idea yet. Once I get it I’m sure it will be simple but for now I am struggling.

Reply

Saksham July 24, 2011 at 9:06 am

Hi, I need a lil’ help Kimi. I tried this tutorial and it works great. The thing is that I don’t use tags in my blog. Can you tell me if I can tune this code to take post from associated categories?

Reply

Know better? Feedbacks, or Questions? Shoot! :-)

Please use a name instead of blog name or SEO stuff, otherwise it will be deleted right away.

About checkbox → See more my post:how to get rid of spam bots in wordpress post.

Thank you for visiting, you're always welcomed to be here again!

Previous post:

Next post: