Monday, August 17, 2015

How to hide related post from blogger front page?

In former tutorial we have learnt how to add a related post widget using LinkWithin. In that if you're really observant, you must have found out that related post not only appears on your front page but also in your post page.

It's good - readers are persuaded to open related post twice. But it appears little bit unprofessional. If we remove it from home page makes it to appear only when readers open post, things will appear clean and professional. 
         

Therefore, in this tutorial let us learn how to hide this widget from homepage and make visible only when readers open a post page. To get this, follow the given steps:

If you have already added this widget, remove it. To do this, open a layout of your blog and click on edit button of this LinkWithin widget. 

Once removal is done, re-install this widget once more. All the steps remain same until the widget opens to Add Page Element.

When add page element is being opened, click on Edit Template and in there you'll find the given HTML:
<b:includable id="main"><data:content /></b:includable>

If we keep this code as it is, then related post will appear in in homepage as well as in post page of your post. But if you want to hide it from the homepage, replace above code with:


<b:includable id="main"><b:if cond='data:blog.pageType == &quot;item&quot;'><data:content /></b:if></b:includable>

Once it's being replaced, click on add Widget button. All the steps from there will remain same just like I have explained in earlier post. Hope you got it right. Cheers!
 

No comments:

Read our comment Policy to know your rights & responsibilities before actually leaving a comment for this article.

Related Posts Plugin for WordPress, Blogger...