How to keep a widget on home page and hide it on blog post?


#1

Hi fellow bloggers, I need to remove the blue widget seen on the images below and have them only on the front page. Anyone know how to do it?

thanks


#2

Hello @Alberts You Can Easily Do This By Following Certain Steps-

Note- First Backup Your Template so in case of any problem you can revert it :smile:

STEPS-

1- Go To Blogger >> Template 2- Press Ctrl+f To Find Your Widget Title Which You Want To Show Only On Homepage 3- For Example You Have Recent Posts Widget Then You Will Find A Code Like This -

    <b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:includable>
</b:widget>

4- Now Copy These Codes-

<b:if cond='data:blog.url == data:blog.homepageUrl'>

</b:if>

5- Paste These Codes Like This In Your Widget Code-

<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'><!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if></b:includable>
</b:widget>

5- Finally Save Your Template And Check Your Results :smile:


#3

@ngtechzone you showed and great method! :clap: but that’s for the wrong widget he doesn’t want to hide recent posts indeed he wants to hide that image on post pages.I guess :wink:

Just search for #HTML10

and paste this code below <b:includable id='yourwidgetid'>

<b:if cond='data:blog.pageType!= "item"'>

and this code above </b:includable>

</b:if>

and tell me if it worked or ain’t


#4

Bro I Gave Him Example Of Recent Posts Widget :laughing: Just To Explain Him :smile:


#5

Its okay but he may get confused so it is better that we provide directly the solution


#6

@ngtechzone, @Nafees you guys are awesome, it worked. God bless you


#7

Glod bless you more. :angel:
I am glad that it worked for you :slight_smile: Keep asking such good questions i am always there to help you :smile: Good Luck :thumbsup: