Adding Related Entries to Mid-Century

Creating the list of related stories on each entry permalink is really easy. This is based on the Devlounge tutorial by Bill Mabray, but I've modified the template code slightly to make it work with Mid-Century. Remember, for this to work your entries have to be tagged consistently.

First, go to Design > Templates and click to edit the "Entry" Archive Template and find the two <mt:Include> tags that insert the Trackbacks and Comments modules. You'll be adding the new template code just above these. Next, copy and paste this code snippet (will open in new window) above the Trackbacks <mt:Include>.

Make sure that when you paste in the snippet the quotes are not converted to smart quotes (“ ”) in MT. It wasn't working for me at first and then I realized that this had happened and had to change all the quotes.

That should do it. Let me know if you have any difficulties.

Related Entries

6 Comments

Yay! It works :)
Thanks Jim!

Seconded - thanks!

is there a way to display only a limited number of related entries?

ps: great post, snippet works perfectly

To limit the number of related entries find this line in the Entry archive template:

<mt:setvarblock name="listitems"><mt:entries tags="$sgtags">...

and add lastn="10" to the mt:entries tag to it looks like:

<mt:setvarblock name="listitems"><mt:entries lastn="10" tags="$sgtags">...

very cool! have you thought about adding any weighting or similar? entries that have more hits get higher priority then those that only match one?

Does this work with dynamically published entries?

Leave a comment

Recent Entries

  • Regular blogging to resume soon

    I've been remiss in not posting here for a few days, but I've been busy with my son's first birthday, my 7th wedding anniversary, an...

  • My pick for best-designed blog

    I have to agree with Chris Basey, who commented on my previous post, that Veerle Pieter's blog is probably the best-designed blog out there. It’s...

  • The best-designed blogs

    What blogs are so well-designed that they make you say, "I wish my blog looked like that"? What is it about them that makes them...

  • Dashes.com now sporting Mid-Century

    Anil Dash's blog has an updated design and I'm proud to say it's a modified version of Mid-Century. Congrats to Anil on the ninth anniversary...

  • Adding Pages to sidebar

    Today I'm going to describe how to add a list of pages to the sidebar in the Mid-Century theme. The example I'm giving here creates...

Close