Tuesday, January 14, 2014

How to hide Addthis share button from Homepage

In the tutorial How to add social share buttons bellow Blog post,i have shown you how to add Addthis share buttons bellow blog post,now i am going to show you how it can be shown only on the post pages,i.e all the pages except the Homepage,because it is not necessary to show on homepage for the post with jump break.

Follow the following steps carefully
1) Go to Blogger------Design------Edit HTML
2) Backup your template
3) Now press Ctrl+F and search for the code bellow


<!-- AddThis Button BEGIN -->


The Addthis codes will look like this


 <!-- AddThis Button BEGIN --> <div class=addthis_toolbox addthis_default_style > <a class=addthis_button_facebook_like fb:like:layout=button_count/> <a class=addthis_button_tweet/> <a class=addthis_button_pinterest_pinit/> <a class=addthis_counter addthis_pill_style/> </div> <script type=text/javascript>var addthis_config = {&quot;data_track_addressbar&quot;:true};</script> <script src=http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-50068963165669d6 type=text/javascript/> <!-- AddThis Button END -->


4) Now add the code <b:if cond=data:blog.pageType == &quot;item&quot;> before the above codes
5) Add the code </b:if> bellow the above codes


After the modification,the whole codes for showing Share buttons only on post pages i.e hiding the share buttons from Homepage will look like this

<b:if cond=data:blog.pageType == &quot;item&quot;><!-- AddThis Button BEGIN --><div class=addthis_toolbox addthis_default_style ><a class=addthis_button_facebook_like fb:like:layout=button_count/><a class=addthis_button_tweet/><a class=addthis_button_pinterest_pinit/><a class=addthis_counter addthis_pill_style/></div><script type=text/javascript>var addthis_config = {&quot;data_track_addressbar&quot;:true};</script><script src=http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-50068963165669d6 type=text/javascript/><!-- AddThis Button END --></b:if>           

6) Now click on save
  • If you get any problem in implementing the codes contact me

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.