I recently installed LinkWithin to my blog since after changing my template, I forgot to backup my previous code on 'related posts list' widget.
LinkWithin is a blog widget that appears under each post, linking to related stories from your blog archive.
I find this widget nicer than my old one since it has thumbnails that attract more attention and it is easy to install. The only issue I hate about this is that it messes up my front page index by polluting it with lots of thumbnails. It gives me a lot of pictures that make my blog's home page too colorful.
So basically, what I wanted is to remove the LinkWithin widget on the homepage and show it only when a blog article's page is opened. So here's a step by step solution on how to solve this.
Steps on how to remove LinkWithin on blogger's home page
- Log-in to blogger and go to
'Design' > 'Edit HTML'
- Though optional, it is always recommended to back up your current template before digging to the code. So make sure to click on
'Download Full Template'.
'Expand Widget Templates'
- Look for
locked='false' title='LinkWithin' type='HTML'.
on your template. You should find something like this:
<b:widget id="HTML4" locked="false" title="LinkWithin" type="HTML"> <b:includable id="main"><data:content></data:content></b:includable> </b:widget>
take note of the widget's id, which is HTML4 in my example. This is usually a unique id generated by blogger and so this might be different in your case.
Replace the code
- Save and view your home page now.
<b:includable id="main"><data:content></data:content></b:includable>with this one:
<b:includable id='main'> <b:if cond='data:blog.pageType == "item&quot;'> <data:content /> </b:if> </b:includable>
And that's it! So if you are like me who hates the same thing about LinkWithin, then the code above should do the trick.
Happy coding :)
UPDATE 03/01/13: Updated code issue about quotations and apostrophe.